diff options
Diffstat (limited to 'BKULocalApp/src/main/java/at/gv')
-rw-r--r-- | BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/BKULauncher.java | 15 | ||||
-rw-r--r-- | BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/Container.java | 23 |
2 files changed, 5 insertions, 33 deletions
diff --git a/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/BKULauncher.java b/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/BKULauncher.java index 091843e1..9a953f9e 100644 --- a/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/BKULauncher.java +++ b/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/BKULauncher.java @@ -168,20 +168,6 @@ public class BKULauncher implements BKUControllerInterface { }
}
- public void jwsHack() {
- InputStream is = getClass().getClassLoader().getResourceAsStream(
- "BKULocal-1.0-SNAPSHOT.war");
- File f = new File(System.getProperty("user.home") + "/.mocca/war");
- f.mkdirs();
- try {
- OutputStream os = new FileOutputStream(new File(f, "mocca.war"));
- StreamUtil.copyStream(is, os);
- os.close();
- } catch (Exception e) {
- log.error(e);
- }
- }
-
/**
* @param args
*/
@@ -189,7 +175,6 @@ public class BKULauncher implements BKUControllerInterface { try {
BKULauncher launcher = new BKULauncher();
- //launcher.jwsHack();
launcher.checkConfig(args);
launcher.startUpServer();
launcher.initTrayIcon();
diff --git a/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/Container.java b/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/Container.java index 690639f4..a8a6431a 100644 --- a/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/Container.java +++ b/BKULocalApp/src/main/java/at/gv/egiz/bku/local/app/Container.java @@ -2,6 +2,8 @@ package at.gv.egiz.bku.local.app; import java.io.File;
import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -12,7 +14,6 @@ import org.mortbay.jetty.handler.DefaultHandler; import org.mortbay.jetty.handler.HandlerCollection;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.webapp.WebAppClassLoader;
import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.thread.QueuedThreadPool;
@@ -26,8 +27,6 @@ public class Container { }
public void init() {
- Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
- log.debug("-----------------> "+ClassLoader.getSystemClassLoader());
server = new Server();
QueuedThreadPool qtp = new QueuedThreadPool();
qtp.setMaxThreads(5);
@@ -56,21 +55,9 @@ public class Container { WebAppContext webappcontext = new WebAppContext();
webappcontext.setContextPath("/");
webappcontext.setExtractWAR(false);
-
- File tmpDir = new File(System.getProperty("user.home") + "/.mocca/tmp");
- // tmpDir.mkdirs();
- // webappcontext.setTempDirectory(tmpDir);
- try {
- File f = new File(System.getProperty("user.home")
- + "/.mocca/war/mocca.war");
- log.debug("Deploying war: " + f.getCanonicalPath());
- if (!f.exists()) {
- log.error("WAR file does not exist, cannot run MOCCA");
- }
- webappcontext.setWar(f.getParent());
- } catch (IOException e) {
- log.error(e);
- }
+ System.out.println(getClass().getClassLoader().getResource("log4j.properties"));
+ webappcontext.setWar("BKULocal-1.0-SNAPSHOT.war");
+
handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() });
server.setHandler(handlers);
|