Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty 7 and knopflerfish 3

I succesfully installed and run an instance of Jetty 7 (latest version, 7.1.6) inside Knopflerfish 3.0. I got working servlets, JSPs and continuations. Did not test tag libraries.

My goal was to install war archives that could have access to the BundleContext so that servlets could interact with other services installed inside the OSGi framework. There has been a couple of confusing moments, especially when I found that the jetty.xml in the "etc" directory (not the etc inside the jetty.osgi.boot bundle), installs either a WebAppProvider (that - as in the jetty standalone configuration - monitors the contexts directory for xml files and the webapps directory for wars) and also an OSGIAppProvider that installs web applications only via contexts (and monitors the same directories as the WebAppProvider). Seeing that a WebAppProvider and an OSGiAppProvider seems similar, I'd like to know if a WebAppProvider should not be used inside an OSGi installation and if it could cause problems (i.e. classloading problems).

But anyway, the only way I found I could install a war that could have access to its bundlecontext is only by installing and *starting* a war file like it was a bundle (i.e. with a META-INF/MANIFEST.MF correctly set up). I don't know if the OSGiAppProvider can insert the bundlecontext property inside the servlet contexts, by just looking at the source code it doesn't seems to me. The wiki page (http://wiki.eclipse.org/Jetty/Feature/Jetty_OSGi) doesn't clearly states how this feature can be enable and used.

The only problems I encountered were using the test.war that comes with the jetty binary distribution. Loading it from the webapp directory using the AppDeployer causes the following errors: - TransparentProxy fails to be installed as it generates a NoClassDefFoundError for javax.net.ssl.TrustManager (i had the framework bootdelegating * and put javax.net and javax.net.ssl into exported system packages). I could not find the cause for this exception. - TestFilter causes a NoClassDefFoundError on init for org/eclipse/jetty/util/log/Log I should note that test.war contains jetty jars inside its WEB-INF/lib directory that I removed before deploying it into the webapp directory.

There is also a strange ClassNotFoundException for org.eclipse.jetty.jsp.JettyLog. I traced the source of the problem in the WebXmlProcessor class inside org.eclipse.jetty.webapp package, but it seems that the JettyLog class isn't bundled anywhere (it is in the jetty-jsp-2.1 module inside the jetty source distribution but that module seems like it isn't packaged as a bundle). Looking at the code for that class there's also a dependency from com.sun.org.apache.commons.logging package so probably that would cause some issues.

That's all; attached you can find a working init.xargs for knopflerfish; your path may (of course) vary.

Regards

--
LM
-Dorg.osgi.framework.dir=D:\work\sandbox\rumenta\varie\kfroot/fwdir
-Dorg.knopflerfish.log.level=debug
-Dorg.knopflerfish.log.out=true
-Dorg.knopflerfish.log.grabio=true
-Dorg.knopflerfish.framework.bundlestorage.checksigned=false
-Dorg.osgi.framework.bootdelegation=*
-Dorg.knopflerfish.framework.system.export.all=true
-Dorg.osgi.framework.system.packages=javax.script, javax.xml.stream, javax.xml.soap, javax.crypto.spec, javax.crypto, javax.activation, org.xml.sax, org.xml.sax.helpers, javax.net, javax.net.ssl
-Dorg.knopflerfish.log.file.dir=logs
-Djetty.home=D:\\work\\sandbox\\EclipseRTWebStarterKit-3.6.0.v20100715
# -Dorg.eclipse.jetty.util.log.stderr.DEBUG=true
-init 
-initlevel 1
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.slf4j.api_1.5.11.v20100519-1910.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.slf4j.jul_1.5.11.v20100419-1106.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\ch.qos.logback.core_0.9.19.v20100419-1216.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\ch.qos.logback.slf4j_0.9.19.v20100519-1910.jar
-install file:D:\apps\knopflerfish_osgi_2.1.1\knopflerfish.org\osgi\jars\log\log_all-2.0.1.jar
-install file:D:\apps\knopflerfish_osgi_2.1.1\knopflerfish.org\osgi\jars\cm\cm_all-2.0.1.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.transaction_1.1.1.v201004190952.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.mail.glassfish_1.4.1.v201005082020.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.servlet_2.5.0.v200910301333.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.el_2.1.0.v201004190952.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.servlet.jsp_2.1.0.v201004190952.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\javax.servlet.jsp.jstl_1.2.0.v201004190952.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jdt.core.compiler.batch_3.6.0.I20100608-0911.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.apache.jasper.glassfish_2.1.0.v201007080150.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.continuation_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.server_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.deploy_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.io_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.util_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.webapp_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.websocket_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.servlet_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.http_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.security_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.xml_7.1.6.v20100715.jar
-initlevel 2
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.osgi.boot_7.1.6.v20100715
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.osgi.boot.jsp_7.1.6.v20100715.jar
-install file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.osgi.boot.warurl_7.1.6.v20100715.jar
-install file:D:\work\sandbox\rumenta\varie\apps\WebSample.war
-startlevel 2
-launch 
-start file:D:\apps\knopflerfish_osgi_2.1.1\knopflerfish.org\osgi\jars\cm\cm_all-2.0.1.jar
-start file:D:\apps\knopflerfish_osgi_2.1.1\knopflerfish.org\osgi\jars\log\log_all-2.0.1.jar
-start file:D:\work\sandbox\EclipseRTWebStarterKit-3.6.0.v20100715\plugins\org.eclipse.jetty.osgi.boot_7.1.6.v20100715
-start file:D:\work\sandbox\rumenta\varie\apps\WebSample.war

Back to the top