Quantcast
Channel: zeroturnaround.com » All Posts
Viewing all articles
Browse latest Browse all 2540

Resources not available in Tomcat 8 when using JRebel

$
0
0

There seems to be some problem with JRebel and Resources configuration in Tomcat 8.

If you configure a resource in the context configuration like this:

<Context docBase="mywebapp.war">
 <Resources>
   <PreResources base="/opt/www/images" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/images" />
 </Resources>
</Context>

Then that “/images” resource will not be available when using JRebel agent. It used to work just fine with JRebel 6.2.2, but all versions after that fails to load the resource.

There’s no error message in the logs but it’s easy to verify the issue by adding this code to a ContextListener’s contextInitialized(…) method:

URL imagesUrl = servletContext.getResource("/images");

Then imagesUrl will be null. Without JRebel agent or with JRebel agent version 6.2.2 or older it will return the correct URL. I’ve tried this with JRebel 6.2.3, 6.2.4 and 6.2.5, both legacy version and non legacy version.

Is this a bug or is there a way around this issue?


Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>