Skip to content

Commit 1245a4a

Browse files
committed
Merge branch 'master' of github.com:NLPchina/Jcoder
2 parents 35af43d + 3f53718 commit 1245a4a

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222
compile 'org.nutz:nutz:1.r.56.r3'
2323
compile 'com.alibaba:fastjson:1.1.33'
2424
compile 'com.h2database:h2:1.3.176'
25-
compile 'com.alibaba:druid:1.0.9'
25+
compile 'com.alibaba:druid:1.0.15'
2626
compile 'log4j:log4j:1.2.16'
2727
compile 'org.slf4j:slf4j-log4j12:1.6.1'
2828
compile 'org.quartz-scheduler:quartz:2.2.1'

src/main/java/Bootstrap.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void main(String[] args) throws Exception {
3434
System.err.println("are you sure ? -f not -f=file ! it not can use!");
3535
}
3636
}
37-
37+
3838
for (String arg : args) {
3939
if (arg.startsWith("--") && arg.contains("=")) {
4040
String[] dim = arg.split("=");
@@ -61,7 +61,7 @@ public static void main(String[] args) throws Exception {
6161
String logPath = getOrCreateEnv(PREFIX + "log", "log/jcoder.log");
6262

6363
String home = getOrCreateEnv(PREFIX + "home", new File(System.getProperty("user.home"), ".jcoder").getAbsolutePath());
64-
64+
6565
int port = Integer.parseInt(getOrCreateEnv(PREFIX + "port", "8080"));
6666

6767
System.setProperty("java.awt.headless", "true"); //support kaptcha
@@ -81,7 +81,7 @@ public static void main(String[] args) throws Exception {
8181
context.setTempDirectory(new File(jcoderHome, "tmp"));
8282
context.setContextPath("/");
8383
context.setServer(server);
84-
84+
8585
context.setWelcomeFiles(new String[] { "Home.jsp" });
8686

8787
context.setExtraClasspath(new File(jcoderHome, "resource").getAbsolutePath());
@@ -92,19 +92,21 @@ public static void main(String[] args) throws Exception {
9292
} else {
9393
context.setWar("src/main/webapp");
9494
}
95-
96-
context.setInitParameter("org.eclipse.jetty.servlet.DefaultServlet.useFileMappedBuffer", "false");
97-
98-
HandlerList list = new HandlerList() ;
95+
96+
HandlerList list = new HandlerList();
9997

10098
WebAppContext web = new WebAppContext(); //add a web site in jcoder
101-
99+
102100
web.setContextPath("/web/");
103-
104-
web.setInitParameter("org.eclipse.jetty.servlet.DefaultServlet.useFileMappedBuffer", "false");
105-
106-
web.setWar(new File(jcoderHome,"web").getAbsolutePath());
107-
101+
102+
web.setWar(new File(jcoderHome, "web").getAbsolutePath());
103+
104+
// Fix for Windows, so Jetty doesn't lock files
105+
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
106+
context.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
107+
web.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
108+
}
109+
108110
list.addHandler(web);
109111

110112
list.addHandler(context);

0 commit comments

Comments
 (0)