Hi Joakim,
Thank you for your answer. However unfortunately, it is not helping.
I made the changes you suggested, so effectively my code now, is
Server server = new Server(port);
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/");
webapp.setExtractWAR(true);
webapp.setWar("E:\\jettyTest\\webapps\\testWebApp.war");
server.setHandler(webapp);
server.start();
But even with this change, I am seeing that the exception still is, as follows
2015-08-14 18:05:48.563:INFO:oejs.Server:OSGi Console: jetty-9.2.12.v20150709
2015-08-14 18:05:48.616:WARN:oejw.WebAppContext:OSGi Console: Failed startup of context
o.e.j.w.WebAppContext@4e8aa935{/,file:/C:/Users/Ksrijith/AppData/Local/Temp/jetty-0.0.0.0-8810-testWebApp.war-_-any-5346091878461296465.dir/webapp/,null}{E:\jettyTest\webapps\testWebApp.war}
java.io.FileNotFoundException: E:\jettyTest\org\eclipse\jetty\webapp\webdefault.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at org.eclipse.jetty.util.resource.FileResource.getInputStream(FileResource.java:290)
at org.eclipse.jetty.webapp.Descriptor.parse(Descriptor.java:54)
at org.eclipse.jetty.webapp.WebDescriptor.parse(WebDescriptor.java:207)
at org.eclipse.jetty.webapp.MetaData.setDefaults(MetaData.java:171)
at org.eclipse.jetty.webapp.WebXmlConfiguration.preConfigure(WebXmlConfiguration.java:53)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:468)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:504)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.microfocus.jettyserver.JettyServer.startServer(JettyServer.java:44)
at com.microfocus.jettyserver.bundle.JettyServerCmdProvider._startServer(JettyServerCmdProvider.java:20)
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:606)
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:150)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
at java.lang.Thread.run(Thread.java:745)
2015-08-14 18:05:48.672:INFO:oejs.ServerConnector:OSGi Console: Started
ServerConnector@716afedb{HTTP/1.1}{0.0.0.0:8810}
>> Jetty 9.2.13.v20150730 is the current stable version of Jetty 9.2.x.
I have not tried moving to that version yet. Shall try that and update, But I am wondering if there is something more to this that I am missing. I did try placing the webdefault.xml that came along with the distribution, in the path it is looking for, but then that failed with some parsing exception.
Thanks,
Srijith.
Click here to report this email as spam.