import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.security.ProtectionDomain;
import java.util.Properties;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
publicfinalclassLauncher{
publicstaticvoidmain(String[] args)throws Exception {
ProtectionDomain domain = Launcher.class.getProtectionDomain();
URL location = domain.getCodeSource().getLocation();
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setWar(location.toExternalForm());
//as enumerated from http://jira.codehaus.org/browse/JETTY-1256
String[] configurations = new String[]{
"org.eclipse.jetty.webapp.WebInfConfiguration"
,"org.eclipse.jetty.webapp.WebXmlConfiguration"
,"org.eclipse.jetty.webapp.MetaInfConfiguration"
,"org.eclipse.jetty.webapp.FragmentConfiguration"
,"org.eclipse.jetty.plus.webapp.EnvConfiguration"
//,"org.eclipse.jetty.plus.webapp.Configuration"
,"org.eclipse.jetty.annotations.AnnotationConfiguration"
,"org.eclipse.jetty.webapp.JettyWebXmlConfiguration"
//,"org.eclipse.jetty.annotations.ContainerInitializerConfiguration"
};
webapp.setAttribute("org.eclipse.jetty.webapp.configuration", configurations);
webapp.setConfigurationClasses(configurations);
int port = 8080;
try{
//NOTE: default port in CONFIGPATH file is 8383
port = Integer.parseInt( load(new File(System.getProperty("CONFIGPATH"))).getProperty("jetty.port"));
}catch(Exception e){
e.printStackTrace();
System.out.println("ERROR: Invalid jetty.port value in configuration file.");
}
Server server = new Server(port);
server.setHandler(webapp);
server.start();
server.join();
}
privatestatic Properties load(File propsFile)throws IOException {
Properties props = new Properties();
FileInputStream fis = null;
try{
fis = new FileInputStream(propsFile);
props.load(fis);
}finally{
try{
fis.close();
}catch(Exception e){
}
}
return props;
}
}
3. web.xml配置
Rest_Servletcom.sun.jersey.spi.container.servlet.ServletContainercom.sun.jersey.config.property.packagescn.firewarm.rest1Rest_Servlet/test/*CORScom.thetransactioncompany.cors.CORSFiltercors.allowOrigin*cors.supportedMethodsGET, POST, HEAD, PUT, DELETE,OPTIONScors.supportedHeadersAccept, Origin, X-Requested-With, Content-Type, Last-Modified,Authorizationcors.exposedHeadersSet-Cookiecors.supportsCredentialstrueCORS/*Archetype Created Web Application
FROM isuper/java-oracle:jre_7
MAINTAINER Liuyg
# Expose the API port
EXPOSE 8080
ADD target target
RUN set -xchmod775 /target/*.sh
# Run the JAR
CMD java -DCONFIGPATH=./target/conf.properties -jar /target/docker-jetty-jersey1.x.war
6. jenkins配置,请参考我的其他文章:
docker下使用jenkins容器构建docker镜像
by 刘迎光@萤火虫工作室 OpenBI交流群:495266201 MicroService 微服务交流群:217722918 mail: liuyg#liuyingguang.cn 博主首页(==防止爬虫==):http://blog.liuyingguang.cn OpenBI问答社区:http://www.openbi.tk
如果希望workflow存储最近20次的log,在session里的Config Object设置,log options做配置,save session log :sessions run ;savesessio log for these runs:20
session下面的source 里面有个tracing 
今天遇到一个客户BUG,当前的jdbc连接用户是root,然后部分删除操作都会报下面这个错误:The user specified as a definer ('aaa'@'localhost') does not exist
最后找原因发现删除操作做了触发器,而触发器里面有这样一句
/*!50017 DEFINER = ''aaa@'localhost' */
原来最初
O7_DICTIONARY_ACCESSIBILITY参数控制对数据字典的访问.设置为true,如果用户被授予了如select any table等any table权限,用户即使不是dba或sysdba用户也可以访问数据字典.在9i及以上版本默认为false,8i及以前版本默认为true.如果设置为true就可能会带来安全上的一些问题.这也就为什么O7_DICTIONARY_ACCESSIBIL
#h1#
0、完成课堂例子
1、将一个四位数逆序打印
1234 ==> 4321
实现方法一:
# include <stdio.h>
int main(void)
{
int i = 1234;
int one = i%10;
int two = i / 10 % 10;
int three = i / 100 % 10;
===================================================================
第一个
===================================================================
try{
CString sql;
sql.Format("select * from p