Skip to main content



      Home
Home » Eclipse Projects » Equinox » Errors after Tomcat reload
Errors after Tomcat reload [message #116394] Fri, 22 August 2008 11:55 Go to next message
Eclipse UserFriend
I have a problem with our struts based web application that we deploy on
tomcat with bridgeservlet and equinox.

The application works fine after it is deployed. But as soon as we
reload the context, the following exception is thrown for any requests:


org.apache.jasper.JasperException: Unable to initialize
TldLocationsCache: No bundle found for URL:
bundleentry://1/web/lib/antlr.jar
org.apache.jasper.compiler.TldLocationsCache.init(TldLocatio nsCache.java:253)
org.apache.jasper.compiler.TldLocationsCache.getLocation(Tld LocationsCache.java:224)
org.apache.jasper.JspCompilationContext.getTldLocation(JspCo mpilationContext.java:526)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parse r.java:422)
.....


After debugging I found the follwing:
- The root of the exception is an IOException thrown in
BundleResourceHandler:openConnection(URL) because the static
BundleContext in BundleResourceHandler is not valid and therefore the
bundle referenced in the URL cannot be found.
- apparently some objects of the "old" framework - ie the framework that
was used before the reload - are still around
- A possible cause for this is in
sun.net.www.protocol.jar.JarFileFactory: JarFileFactory caches instances
of JarFiles and maps JarFiles to URLs. If the JarFileFactory survives a
reload operation it will return "old" URLs that still reference
BundleResourceHandlers with invalid values.


I'm very greatful for any hints and pointers.

Peter
Re: Errors after Tomcat reload [message #116426 is a reply to message #116394] Fri, 22 August 2008 13:24 Go to previous messageGo to next message
Eclipse UserFriend
Bizarre. Holding on to URLs in stopped frameworks is definitely going to
cause problems. From what I can see someone is holding on to one of these
old URLs. When the context is reloaded the OSGi framework is re-rooted with
a whole new class loader so that would lead me to believe the URL is being
cached outside of the OSGi framework.

A few questions...
Is your webapp a pure OSGi based application or is it somehow a mixed
content hybrid?
Is your servletbridge really isolated from the servlet container? e.g. what
is your settings for:
osgi.parentClassloader and osgi.contextClassLoaderParent in your launch.ini?

Any additional info about your config would help.

-Simon

"Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
news:g8mnhn$lib$1@build.eclipse.org...
>I have a problem with our struts based web application that we deploy on
>tomcat with bridgeservlet and equinox.
>
> The application works fine after it is deployed. But as soon as we reload
> the context, the following exception is thrown for any requests:
>
>
> org.apache.jasper.JasperException: Unable to initialize TldLocationsCache:
> No bundle found for URL: bundleentry://1/web/lib/antlr.jar
> org.apache.jasper.compiler.TldLocationsCache.init(TldLocatio nsCache.java:253)
> org.apache.jasper.compiler.TldLocationsCache.getLocation(Tld LocationsCache.java:224)
> org.apache.jasper.JspCompilationContext.getTldLocation(JspCo mpilationContext.java:526)
> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parse r.java:422)
> ....
>
>
> After debugging I found the follwing:
> - The root of the exception is an IOException thrown in
> BundleResourceHandler:openConnection(URL) because the static BundleContext
> in BundleResourceHandler is not valid and therefore the bundle referenced
> in the URL cannot be found.
> - apparently some objects of the "old" framework - ie the framework that
> was used before the reload - are still around
> - A possible cause for this is in sun.net.www.protocol.jar.JarFileFactory:
> JarFileFactory caches instances of JarFiles and maps JarFiles to URLs. If
> the JarFileFactory survives a reload operation it will return "old" URLs
> that still reference BundleResourceHandlers with invalid values.
>
>
> I'm very greatful for any hints and pointers.
>
> Peter
Re: Errors after Tomcat reload [message #116443 is a reply to message #116426] Sat, 23 August 2008 04:25 Go to previous messageGo to next message
Eclipse UserFriend
Dear Simon

Luckily this problem can be reproduced quite easily: It happens with the
struts example application also. Here is what I did:
- Deploy bridge.war (from equinox website)
- Copy the following bundles to bridge/WEB-INF/eclipse/plugins
- org.eclipse.equinox.struts.examples (downloaded from sf.net,
imported into a workspace and built)

- javax.servlet 2.4.0
- javax.servlet.jsp (both from orbit)

- org.apache.jasper
- org.apache.commons.logging
- org.apache.commons.el
- org.apache.ant
- org.eclipse.equinox.jsp.jasper (all 5 from an eclipse 3.4.0 install)

- org.eclipse.equinox.http.helper (from CVS)
- org.eclipse.equinox.jsp.jstl (from sf.net)

With this setup I need to start the struts examples bundle manually in
the console, then I hit
http://localhost:8080/bridge/struts-examples/welcome.do which works
fine. After a reload of the bridge context, the same URL does no longer
work but instead throws the exception below.

To answer your questions:
- pure OSGi, I'm not sure but I think so
- orgi.parentClassLoader and the other one are both set to "ext".

Thanks
Peter


Simon Kaegi schrieb:
> Bizarre. Holding on to URLs in stopped frameworks is definitely going to
> cause problems. From what I can see someone is holding on to one of these
> old URLs. When the context is reloaded the OSGi framework is re-rooted with
> a whole new class loader so that would lead me to believe the URL is being
> cached outside of the OSGi framework.
>
> A few questions...
> Is your webapp a pure OSGi based application or is it somehow a mixed
> content hybrid?
> Is your servletbridge really isolated from the servlet container? e.g. what
> is your settings for:
> osgi.parentClassloader and osgi.contextClassLoaderParent in your launch.ini?
>
> Any additional info about your config would help.
>
> -Simon
>
> "Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
> news:g8mnhn$lib$1@build.eclipse.org...
>> I have a problem with our struts based web application that we deploy on
>> tomcat with bridgeservlet and equinox.
>>
>> The application works fine after it is deployed. But as soon as we reload
>> the context, the following exception is thrown for any requests:
>>
>>
>> org.apache.jasper.JasperException: Unable to initialize TldLocationsCache:
>> No bundle found for URL: bundleentry://1/web/lib/antlr.jar
>> org.apache.jasper.compiler.TldLocationsCache.init(TldLocatio nsCache.java:253)
>> org.apache.jasper.compiler.TldLocationsCache.getLocation(Tld LocationsCache.java:224)
>> org.apache.jasper.JspCompilationContext.getTldLocation(JspCo mpilationContext.java:526)
>> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parse r.java:422)
>> ....
>>
>>
>> After debugging I found the follwing:
>> - The root of the exception is an IOException thrown in
>> BundleResourceHandler:openConnection(URL) because the static BundleContext
>> in BundleResourceHandler is not valid and therefore the bundle referenced
>> in the URL cannot be found.
>> - apparently some objects of the "old" framework - ie the framework that
>> was used before the reload - are still around
>> - A possible cause for this is in sun.net.www.protocol.jar.JarFileFactory:
>> JarFileFactory caches instances of JarFiles and maps JarFiles to URLs. If
>> the JarFileFactory survives a reload operation it will return "old" URLs
>> that still reference BundleResourceHandlers with invalid values.
>>
>>
>> I'm very greatful for any hints and pointers.
>>
>> Peter
>
>
Re: Errors after Tomcat reload [message #116485 is a reply to message #116443] Mon, 25 August 2008 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Peter,

Thanks, that helps. When I get the chance I'll try that out, but for now....
a few things I noticed.

One thing I can see that you will want to fix is the inclusion of the
javax.servlet bundle.
When running under the servletbridge the servlet api comes from the app
server so it's important not have this bundle as it can lead to all sorts of
class loading mixups. On the other hand you do need javax.servlet.jsp as the
servletbridge isolates you from the many not so fun idiosyncrasies of the
JSP engines providided buy the app server vendors.

You definitely should also build your own bridge.war. The bridge.war that is
up on the website is not a formal distribution and was just put up as a
quickstart mechanism. You should download the
org.eclipse.equinox.servletbridge project and run the war builder ant script
to build your own.

HTH
-Simon

"Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
news:g8ohia$34d$1@build.eclipse.org...
> Dear Simon
>
> Luckily this problem can be reproduced quite easily: It happens with the
> struts example application also. Here is what I did:
> - Deploy bridge.war (from equinox website)
> - Copy the following bundles to bridge/WEB-INF/eclipse/plugins
> - org.eclipse.equinox.struts.examples (downloaded from sf.net, imported
> into a workspace and built)
>
> - javax.servlet 2.4.0
> - javax.servlet.jsp (both from orbit)
>
> - org.apache.jasper
> - org.apache.commons.logging
> - org.apache.commons.el
> - org.apache.ant
> - org.eclipse.equinox.jsp.jasper (all 5 from an eclipse 3.4.0 install)
>
> - org.eclipse.equinox.http.helper (from CVS)
> - org.eclipse.equinox.jsp.jstl (from sf.net)
>
> With this setup I need to start the struts examples bundle manually in the
> console, then I hit
> http://localhost:8080/bridge/struts-examples/welcome.do which works fine.
> After a reload of the bridge context, the same URL does no longer work but
> instead throws the exception below.
>
> To answer your questions:
> - pure OSGi, I'm not sure but I think so
> - orgi.parentClassLoader and the other one are both set to "ext".
>
> Thanks
> Peter
>
>
> Simon Kaegi schrieb:
>> Bizarre. Holding on to URLs in stopped frameworks is definitely going to
>> cause problems. From what I can see someone is holding on to one of these
>> old URLs. When the context is reloaded the OSGi framework is re-rooted
>> with a whole new class loader so that would lead me to believe the URL is
>> being cached outside of the OSGi framework.
>>
>> A few questions...
>> Is your webapp a pure OSGi based application or is it somehow a mixed
>> content hybrid?
>> Is your servletbridge really isolated from the servlet container? e.g.
>> what is your settings for:
>> osgi.parentClassloader and osgi.contextClassLoaderParent in your
>> launch.ini?
>>
>> Any additional info about your config would help.
>>
>> -Simon
>>
>> "Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
>> news:g8mnhn$lib$1@build.eclipse.org...
>>> I have a problem with our struts based web application that we deploy on
>>> tomcat with bridgeservlet and equinox.
>>>
>>> The application works fine after it is deployed. But as soon as we
>>> reload the context, the following exception is thrown for any requests:
>>>
>>>
>>> org.apache.jasper.JasperException: Unable to initialize
>>> TldLocationsCache: No bundle found for URL:
>>> bundleentry://1/web/lib/antlr.jar
>>> org.apache.jasper.compiler.TldLocationsCache.init(TldLocatio nsCache.java:253)
>>> org.apache.jasper.compiler.TldLocationsCache.getLocation(Tld LocationsCache.java:224)
>>> org.apache.jasper.JspCompilationContext.getTldLocation(JspCo mpilationContext.java:526)
>>> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parse r.java:422)
>>> ....
>>>
>>>
>>> After debugging I found the follwing:
>>> - The root of the exception is an IOException thrown in
>>> BundleResourceHandler:openConnection(URL) because the static
>>> BundleContext in BundleResourceHandler is not valid and therefore the
>>> bundle referenced in the URL cannot be found.
>>> - apparently some objects of the "old" framework - ie the framework that
>>> was used before the reload - are still around
>>> - A possible cause for this is in
>>> sun.net.www.protocol.jar.JarFileFactory: JarFileFactory caches instances
>>> of JarFiles and maps JarFiles to URLs. If the JarFileFactory survives a
>>> reload operation it will return "old" URLs that still reference
>>> BundleResourceHandlers with invalid values.
>>>
>>>
>>> I'm very greatful for any hints and pointers.
>>>
>>> Peter
>>
Re: Errors after Tomcat reload [message #116500 is a reply to message #116485] Mon, 25 August 2008 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Simon, thanks a lot! Building a new version of the bridge servlet
helped. Also thanks for the other suggestions.

Peter


Simon Kaegi schrieb:
> Hi Peter,
>
> Thanks, that helps. When I get the chance I'll try that out, but for now....
> a few things I noticed.
>
> One thing I can see that you will want to fix is the inclusion of the
> javax.servlet bundle.
> When running under the servletbridge the servlet api comes from the app
> server so it's important not have this bundle as it can lead to all sorts of
> class loading mixups. On the other hand you do need javax.servlet.jsp as the
> servletbridge isolates you from the many not so fun idiosyncrasies of the
> JSP engines providided buy the app server vendors.
>
> You definitely should also build your own bridge.war. The bridge.war that is
> up on the website is not a formal distribution and was just put up as a
> quickstart mechanism. You should download the
> org.eclipse.equinox.servletbridge project and run the war builder ant script
> to build your own.
>
> HTH
> -Simon
>
> "Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
> news:g8ohia$34d$1@build.eclipse.org...
>> Dear Simon
>>
>> Luckily this problem can be reproduced quite easily: It happens with the
>> struts example application also. Here is what I did:
>> - Deploy bridge.war (from equinox website)
>> - Copy the following bundles to bridge/WEB-INF/eclipse/plugins
>> - org.eclipse.equinox.struts.examples (downloaded from sf.net, imported
>> into a workspace and built)
>>
>> - javax.servlet 2.4.0
>> - javax.servlet.jsp (both from orbit)
>>
>> - org.apache.jasper
>> - org.apache.commons.logging
>> - org.apache.commons.el
>> - org.apache.ant
>> - org.eclipse.equinox.jsp.jasper (all 5 from an eclipse 3.4.0 install)
>>
>> - org.eclipse.equinox.http.helper (from CVS)
>> - org.eclipse.equinox.jsp.jstl (from sf.net)
>>
>> With this setup I need to start the struts examples bundle manually in the
>> console, then I hit
>> http://localhost:8080/bridge/struts-examples/welcome.do which works fine.
>> After a reload of the bridge context, the same URL does no longer work but
>> instead throws the exception below.
>>
>> To answer your questions:
>> - pure OSGi, I'm not sure but I think so
>> - orgi.parentClassLoader and the other one are both set to "ext".
>>
>> Thanks
>> Peter
>>
>>
>> Simon Kaegi schrieb:
>>> Bizarre. Holding on to URLs in stopped frameworks is definitely going to
>>> cause problems. From what I can see someone is holding on to one of these
>>> old URLs. When the context is reloaded the OSGi framework is re-rooted
>>> with a whole new class loader so that would lead me to believe the URL is
>>> being cached outside of the OSGi framework.
>>>
>>> A few questions...
>>> Is your webapp a pure OSGi based application or is it somehow a mixed
>>> content hybrid?
>>> Is your servletbridge really isolated from the servlet container? e.g.
>>> what is your settings for:
>>> osgi.parentClassloader and osgi.contextClassLoaderParent in your
>>> launch.ini?
>>>
>>> Any additional info about your config would help.
>>>
>>> -Simon
>>>
>>> "Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
>>> news:g8mnhn$lib$1@build.eclipse.org...
>>>> I have a problem with our struts based web application that we deploy on
>>>> tomcat with bridgeservlet and equinox.
>>>>
>>>> The application works fine after it is deployed. But as soon as we
>>>> reload the context, the following exception is thrown for any requests:
>>>>
>>>>
>>>> org.apache.jasper.JasperException: Unable to initialize
>>>> TldLocationsCache: No bundle found for URL:
>>>> bundleentry://1/web/lib/antlr.jar
>>>> org.apache.jasper.compiler.TldLocationsCache.init(TldLocatio nsCache.java:253)
>>>> org.apache.jasper.compiler.TldLocationsCache.getLocation(Tld LocationsCache.java:224)
>>>> org.apache.jasper.JspCompilationContext.getTldLocation(JspCo mpilationContext.java:526)
>>>> org.apache.jasper.compiler.Parser.parseTaglibDirective(Parse r.java:422)
>>>> ....
>>>>
>>>>
>>>> After debugging I found the follwing:
>>>> - The root of the exception is an IOException thrown in
>>>> BundleResourceHandler:openConnection(URL) because the static
>>>> BundleContext in BundleResourceHandler is not valid and therefore the
>>>> bundle referenced in the URL cannot be found.
>>>> - apparently some objects of the "old" framework - ie the framework that
>>>> was used before the reload - are still around
>>>> - A possible cause for this is in
>>>> sun.net.www.protocol.jar.JarFileFactory: JarFileFactory caches instances
>>>> of JarFiles and maps JarFiles to URLs. If the JarFileFactory survives a
>>>> reload operation it will return "old" URLs that still reference
>>>> BundleResourceHandlers with invalid values.
>>>>
>>>>
>>>> I'm very greatful for any hints and pointers.
>>>>
>>>> Peter
>
Re: Errors after Tomcat reload [message #116859 is a reply to message #116485] Mon, 01 September 2008 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Simon Kaegi schrieb:
<snip/>
> One thing I can see that you will want to fix is the inclusion of the
> javax.servlet bundle.
> When running under the servletbridge the servlet api comes from the app
> server so it's important not have this bundle as it can lead to all sorts of
> class loading mixups. On the other hand you do need javax.servlet.jsp as the
> servletbridge isolates you from the many not so fun idiosyncrasies of the
> JSP engines providided buy the app server vendors.
>


Hi Simon

I tried to remove the javax.servlet bundle but unfortunately
javax.xml.rpc from orbit has a dependency in the require-bundle section
for javax.servlet and therefore some of my bundles won't resolve. What
can I do in this situation? Create my own version of javax.xml.rpc? (and
ask orbit to use import package instead of require bundle)?


Thanks
Peter
Re: Errors after Tomcat reload [message #116992 is a reply to message #116859] Tue, 02 September 2008 22:29 Go to previous messageGo to next message
Eclipse UserFriend
Yes, please log a bug against Orbit and if you wouldn't mind CC me on the
bug and I'll follow up.
AFAIK no-one should be using require-bundle in any of Orbit'd bundles.
-Simon

"Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
news:g9g8m5$t0i$1@build.eclipse.org...
> Simon Kaegi schrieb:
> <snip/>
>> One thing I can see that you will want to fix is the inclusion of the
>> javax.servlet bundle.
>> When running under the servletbridge the servlet api comes from the app
>> server so it's important not have this bundle as it can lead to all sorts
>> of class loading mixups. On the other hand you do need javax.servlet.jsp
>> as the servletbridge isolates you from the many not so fun idiosyncrasies
>> of the JSP engines providided buy the app server vendors.
>>
>
>
> Hi Simon
>
> I tried to remove the javax.servlet bundle but unfortunately javax.xml.rpc
> from orbit has a dependency in the require-bundle section for
> javax.servlet and therefore some of my bundles won't resolve. What can I
> do in this situation? Create my own version of javax.xml.rpc? (and ask
> orbit to use import package instead of require bundle)?
>
>
> Thanks
> Peter
Re: Errors after Tomcat reload [message #117003 is a reply to message #116992] Tue, 02 September 2008 22:51 Go to previous message
Eclipse UserFriend
Nevermind... I found your bug report.
Thanks.
"Simon Kaegi" <simon_kaegi@ca.ibm.com> wrote in message
news:g9kspq$7ie$1@build.eclipse.org...
> Yes, please log a bug against Orbit and if you wouldn't mind CC me on the
> bug and I'll follow up.
> AFAIK no-one should be using require-bundle in any of Orbit'd bundles.
> -Simon
>
> "Peter Kullmann" <p.kullmann@arenae.ch> wrote in message
> news:g9g8m5$t0i$1@build.eclipse.org...
>> Simon Kaegi schrieb:
>> <snip/>
>>> One thing I can see that you will want to fix is the inclusion of the
>>> javax.servlet bundle.
>>> When running under the servletbridge the servlet api comes from the app
>>> server so it's important not have this bundle as it can lead to all
>>> sorts of class loading mixups. On the other hand you do need
>>> javax.servlet.jsp as the servletbridge isolates you from the many not so
>>> fun idiosyncrasies of the JSP engines providided buy the app server
>>> vendors.
>>>
>>
>>
>> Hi Simon
>>
>> I tried to remove the javax.servlet bundle but unfortunately
>> javax.xml.rpc from orbit has a dependency in the require-bundle section
>> for javax.servlet and therefore some of my bundles won't resolve. What
>> can I do in this situation? Create my own version of javax.xml.rpc? (and
>> ask orbit to use import package instead of require bundle)?
>>
>>
>> Thanks
>> Peter
>
>
Previous Topic:Unsupported Install
Next Topic:Programmatically add BuddyClass-Loading to a Bundle
Goto Forum:
  


Current Time: Fri May 02 04:44:05 EDT 2025

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

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

Back to the top