to fix the illegal state exception
i switched the order of app-binding and jetty-server-starting; now it gets a bit farther but throws another exception: 2012-03-20 10:25:35.550:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.servlet.ServletHandler@177f409c: java.lang.ClassCastException: org.eclipse.jetty.server.handler.ContextHandler cannot be cast to org.eclipse.jetty.servlet.ServletContextHandler java.lang.ClassCastException: org.eclipse.jetty.server.handler.ContextHandler cannot be cast to org.eclipse.jetty.servlet.ServletContextHandler at org.eclipse.jetty.servlet.ServletHandler.doStart(ServletHandler.java:147) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90) at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:97) at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:722) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59) at helma.main.ApplicationManager$AppDescriptor.bind(ApplicationManager.java:550) at helma.main.ApplicationManager.startAll(ApplicationManager.java:168) at helma.main.Server.run(Server.java:602) at java.lang.Thread.run(Thread.java:662)
This commit is contained in:
parent
bb8aba7adc
commit
786a5e86bd
1 changed files with 9 additions and 9 deletions
|
@ -78,7 +78,7 @@ public class Server implements Runnable {
|
||||||
|
|
||||||
// the XML-RPC server
|
// the XML-RPC server
|
||||||
protected WebServer xmlrpc;
|
protected WebServer xmlrpc;
|
||||||
|
|
||||||
Thread shutdownhook;
|
Thread shutdownhook;
|
||||||
|
|
||||||
|
|
||||||
|
@ -512,18 +512,18 @@ public class Server implements Runnable {
|
||||||
// exception in xmlrpc server shutdown, ignore.
|
// exception in xmlrpc server shutdown, ignore.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (helmaLogging) {
|
if (helmaLogging) {
|
||||||
Logging.shutdown();
|
Logging.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
server = null;
|
server = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Runtime.getRuntime().removeShutdownHook(shutdownhook);
|
Runtime.getRuntime().removeShutdownHook(shutdownhook);
|
||||||
// HACK: running the shutdownhook seems to be necessary in order
|
// HACK: running the shutdownhook seems to be necessary in order
|
||||||
// to prevent it from blocking garbage collection of helma
|
// to prevent it from blocking garbage collection of helma
|
||||||
// classes/classloaders. Since we already set server to null it
|
// classes/classloaders. Since we already set server to null it
|
||||||
// won't do anything anyhow.
|
// won't do anything anyhow.
|
||||||
shutdownhook.start();
|
shutdownhook.start();
|
||||||
shutdownhook = null;
|
shutdownhook = null;
|
||||||
|
@ -598,6 +598,9 @@ public class Server implements Runnable {
|
||||||
logger.error("Error setting security manager", x);
|
logger.error("Error setting security manager", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// start applications
|
||||||
|
appManager.startAll();
|
||||||
|
|
||||||
// start embedded web server
|
// start embedded web server
|
||||||
if (jetty != null) {
|
if (jetty != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -607,9 +610,6 @@ public class Server implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start applications
|
|
||||||
appManager.startAll();
|
|
||||||
|
|
||||||
while (Thread.currentThread() == mainThread) {
|
while (Thread.currentThread() == mainThread) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(3000L);
|
Thread.sleep(3000L);
|
||||||
|
|
Loading…
Add table
Reference in a new issue