Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Problem Integrating OSGi, Jetty 6, and Glassfish Jasper
Problem Integrating OSGi, Jetty 6, and Glassfish Jasper [message #103234] Fri, 04 January 2008 02:55 Go to next message
Eclipse UserFriend
Originally posted by:

I am trying to integrate OSGi, Jetty 6.1.6, and the Glassfish
version of the Apache Jasper JSP compiler as an embedded web server in a
desktop application. The Server-Side Equinox project uses Jetty 5, so
I've resorted to rolling my own bridge code instead of relying on the
Equinox Http Service implementation. In addition, I want the flexibility
to serve pages from the file system in addition to serving pages packaged
in OSGi bundles (unless I am mistaken, this is not a typical feature of
the Server-Side Equinox implementation).

For the most part, things are working pretty well. The application is
able to serve static content just fine using the Jetty Default Servlet.
If I point the web root at the file system, I can also serve JSP pages,
including cool things like the JSTL tag library.

The problem comes when I try to serve JSP pages that are packaged in an
OSGi bundle:

2008-01-03 07:47:33.013::WARN: /scripts/scriptaculous.js
at Source)
at Source)
at Source)
at Source)
at Source)
org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleEntry.getIn putStream(
org.eclipse.osgi.framework.internal.core.BundleURLConnection .connect(
org.eclipse.osgi.framework.internal.core.BundleURLConnection .getInputStream(
at org.mortbay.resource.URLResource.exists( )
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:487)
at org.mortbay.jetty.Server.handle(
org.mortbay.jetty.HttpConnection$RequestHandler.headerComple te(
at org.mortbay.jetty.HttpParser.parseNext(
at org.mortbay.jetty.HttpParser.parseAvailable( 211)
at org.mortbay.jetty.HttpConnection.handle( 381)

When I try to retrieve the above file "scriptaculous.js" directly using
the browser, it works fine. It's only a problem when the javascript or
css file is referenced from within a JSP file.

There are very sparse priors on this type of issue. A google search on
the NullPointerException thrown from
only returns a few message boards with people asking dissimilar questions
that were never answered satisfactorily.

I have resorted to analyzing the source code for the JDK, OSGi framework,
and Jetty. It appears that the only way this kind of exception can be
thrown is if someone closes the ZipFile prematurely. Closing the ZipFile
will invalidate all of the Inflater objects associated with it, and will
result in a NullPointerException being thrown from the ensureOpen() method
on line 333 of in JDK 6, dated 06/04/07.

My problem is that I have no idea why that would be happening, and I can't
think of a way to localize the bug to the JDK, OSGi framework, Jetty, or

I'm willing to entertain the idea that the bug is in my code, except that
I didn't really write any code related to this. All I am doing is
configuring Jetty/Jasper with a URL identifying "bundleentry://12/web" as
the web root.

Any suggestions on how to proceed would be most appreciated.

Thanks and happy new year.
Re: Problem Integrating OSGi, Jetty 6, and Glassfish Jasper [message #103269 is a reply to message #103234] Fri, 04 January 2008 07:52 Go to previous message
Eclipse UserFriend
Originally posted by:

Hmmn, I think I might be experiencing a variation on bug 193269:

Seems to be the same symptom, anyway - throwing NPE from
Previous Topic:Update Manager vs. Equinox P2
Next Topic:Config admin and metatype services
Goto Forum:

Current Time: Tue Oct 26 05:39:41 GMT 2021

Powered by FUDForum. Page generated in 0.02206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top