Compiled war doesn't run (with jetty) - expects web.xml
Closed this issue · 1 comments
jeanbza commented
When I try to start with jetty (below example using jetty runner for easier example), I get a typicaly nullPointerExample as WebXmlParser is trying to access web.xml. I believe this is a problem with the app, but please correct me if I'm wrong and it's a problem with how I'm running the war.
jadekler at Jeans-MacBook-Pro in ~/workspace
$ java -jar jetty-runner.jar ~/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war
2015-02-15 20:36:31.048:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
2015-02-15 20:36:31.049:INFO::Runner
2015-02-15 20:36:31.049:WARN::No tx manager found
2015-02-15 20:36:31.074:INFO::Deploying file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war @ /
[WebAppContext@7a07c5b4@7a07c5b4/,null,file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war]
2015-02-15 20:36:31.083:INFO::jetty-7.0.0.v20091005
2015-02-15 20:36:31.108:INFO::Extract jar:file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war!/ to /private/var/folders/15/r6j3mdp97p5247bkkj94p4v00000gn/T/Jetty_0_0_0_0_8080_example.spring.initializer.1.0.SNAPSHOT.war____.wa9uz3/webapp
2015-02-15 20:36:31.340:WARN::Failed startup of context WebAppContext@7a07c5b4@7a07c5b4/,file:/private/var/folders/15/r6j3mdp97p5247bkkj94p4v00000gn/T/Jetty_0_0_0_0_8080_example.spring.initializer.1.0.SNAPSHOT.war____.wa9uz3/webapp/,file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war
java.lang.NullPointerException
at org.eclipse.jetty.webapp.WebXmlProcessor.parseFragment(WebXmlProcessor.java:316)
at org.eclipse.jetty.webapp.FragmentConfiguration.parseWebFragments(FragmentConfiguration.java:93)
at org.eclipse.jetty.webapp.FragmentConfiguration.preConfigure(FragmentConfiguration.java:47)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:339)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at org.eclipse.jetty.server.Server.doStart(Server.java:232)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.mortbay.jetty.runner.Runner.run(Runner.java:448)
at org.mortbay.jetty.runner.Runner.main(Runner.java:587)
2015-02-15 20:36:31.355:INFO::Started SelectChannelConnector@0.0.0.0:8080
^C2015-02-15 20:36:32.622:INFO::Shutdown hook executing
2015-02-15 20:36:32.687:INFO::Shutdown hook complete
bkielczewski commented
2015-02-15 20:36:31.083:INFO::jetty-7.0.0.v20091005
Jetty 7 your jetty-runner.jar uses is ancient and does not work with Servlet API 3.0, which is needed to get rid of web.xml.