开发者

jetty throws exception after `java -jar start.jar`

I get the following error when I run java -jar start.jar. sudo service jetty start works just fine. What seems to be the problem? There are no webapps deployed, its a new install. I have changed the /etc/default/jetty file to enable the service to start.

 wissen12@wissen12:/usr/share/jetty$ java -jar start.jar 
    7 [main] INFO org.mortbay.util.FileResource - Checking Resource aliases
    396 [main] WARN org.mortbay.xml.XmlConfiguration - EXCEPTION 
    java.lang.NoSuchMethodException: class org.mortbay.jetty.Server.setThreadPool(class org.mortbay.thread.QueuedThreadPool)
     at org.mortbay.xml.XmlConfiguration.set(XmlConfiguration.java:417)
     at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:231)
     at org.mortbay.xml.XmlConfiguration.newInstance(XmlConfiguration.java:198)
     开发者_如何学JAVAat org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:880)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:616)
     at org.mortbay.start.Main.invokeMain(Main.java:194)
     at org.mortbay.start.Main.start(Main.java:534)
     at org.mortbay.start.Main.start(Main.java:441)
     at org.mortbay.start.Main.main(Main.java:119)

Thanks.


I had the exact same problem. Upgrading from Jetty 7.1.x to 7.4.x solved it. Looking at the source code, it looks like Jetty's XML bean handling added a lot more fallback cases for non-exact type matching in setters.


There are 2 possibilities that stand out as the most likely cause:

  1. The server configuration file (jetty.xml) that you're using does not match the version of Jetty that you're using.

  2. The versions do match, but the setThreadPool method is throwing an exception which is being lost

The 2nd seems more likely, so you should follow the instructions on this page http://docs.codehaus.org/display/JETTY/Debugging to turn on "ignored exception" logging.

I expect you'll find that an exception is being throw during the call to "Server.setThreadPool" and that is being "ignored" and treated as a "NoSuchMethod" exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜