Hi,
I was finally able to get this to work. Here are the things I had to do.
1) I upgraded OSGi from 3.4 version to 3.6, just in case that was the problem.
2) I had missed including jetty-servlets jar in the list of bundles, so included that jar
3) Started a small webapp, as mentioned above. Did not run into issues. Was able to set defaultDescriptor as null
4) Later used WebAppProvider class, but this kept failing with this problem (
http://stackoverflow.com/questions/29274336/getting-java-lang-classnotfoundexception-org-eclipse-jetty-servlet-listener-int)
java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.listener.IntrospectorCleaner
In order to resolve this, had to alter the jetty-webapp manifest to import org.jetty.servlet.listener package.
Now the webapps are correctly getting deployed for me. I also had to specify a proper defaultDescriptor for it to work when using WebAppProvider
Also another problem I found was that the server does not now work with my legacy web applications, as the DTD for web.xml appears to be different
My web.xml had <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">, and this was causing error
osgi> 2015-08-17 18:03:09.578:WARN:oejx.XmlParser:Scanner-2: FATAL@http://www.oracle.com/webfolder/technetwork/jsc/j2ee/dtds/web-app_2_3.dtd line:1 col:1 : org.
xml.sax.SAXParseExceptionpublicId: -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN; systemId: http://www.oracle.com/webfolder/technetwork/jsc/j2ee/dtds/w
eb-app_2_3.dtd; lineNumber: 1; columnNumber: 1; The markup declarations contained or pointed to by the document type declaration must be well-formed.
2015-08-17 18:03:09.581:WARN:oejw.WebAppContext:Scanner-2: Failed startup of context o.e.j.w.WebAppContext@611cd826{/zenworks-ping,file:/C:/Users/Ksrijith/AppDa
ta/Local/Temp/jetty-0.0.0.0-7629-zenworks-ping.war-_zenworks-ping-any-4389934712582603675.dir/webapp/,null}{E:\jettyTest\webapps\zenworks-ping.war}
org.xml.sax.SAXParseExceptionpublicId: -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN; systemId: http://www.oracle.com/webfolder/technetwork/jsc/j2ee/dt
ds/web-app_2_3.dtd; lineNumber: 1; columnNumber: 1; The markup declarations contained or pointed to by the document type declaration must be well-formed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
So overall was able to get things to work, but looks like I will have to make a lot of changes here and there :(.
Thanks for all the help.
Thanks,
Srijith
There are people on this forum that work on the jetty-osgi layers, stick around, they'll show up.
You might have more luck using those layers vs making your own bundle.
I just can't help you, as I avoid OSGi with a 100km pole.
But I know that the jetty-osgi layers represent at least 1,000 man hours of effort between all of the jetty and osgi experts that commit to it.