tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Sexton" <gsex...@mhsoftware.com>
Subject RE: missing resource bundle shouldn't be
Date Mon, 06 Sep 2004 20:18:02 GMT
Different class loader. The JSP's are running in a class-loader with the
application, while the common/lib jars are in a different class-loader where
the WEB-INF/classes are not part of the search path.

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

> -----Original Message-----
> From: Garret Wilson [mailto:garret@globalmentor.com] 
> Sent: Monday, September 06, 2004 11:40 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: missing resource bundle shouldn't be
> 
> Oh, and I'm using JDK 1.5 RC.
> 
> Garret
> 
> Garret Wilson wrote:
> > I just installed Tomcat 5.5.0 on Windows XP Professional 
> SP2. I have an 
> > existing application that worked under Tomcat 4.x. It consists of a 
> > servlet in a jar file located here:
> > 
> > \tomcat\common\lib\myservlet.jar
> > 
> > That jar contains a servlet mapped to, for example:
> > 
> > <servlet-mapping>
> >   <servlet-name>myservlet</servlet-name>
> >   <url-pattern>/myservlet/test</url-pattern>
> > </servlet-mapping>
> > 
> > I have a resource bundle installed here:
> > 
> > ...mywebapp\WEB-INF\classes\myresourcebundle.properties
> > 
> > My JSP files do the following with no problem:
> > 
> > ResourceBundle.getBundle("myresourcebundle");
> > 
> > However, when my servlet in my jar tries to execute the 
> exact same code, 
> > I get:
> > 
> > java.util.MissingResourceException: Can't find bundle for base name 
> > myresourcebundle, locale en_US
> >     
> java.util.ResourceBundle.throwMissingResourceException(Resourc
> eBundle.java:837) 
> > 
> >     java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:727)
> >     java.util.ResourceBundle.getBundle(ResourceBundle.java:577)
> > 
> > [etc.]
> > 
> > * I've tried taking my servlet out of a jar and putting it in 
> > ...mywebapp\WEB-INF\classes\
> > 
> > * I've tried copying my resource bundles to 
> ...mywebapp\WEB-INF\classes\ 
> > to the same subdirectory as the actual classfiles (even 
> though I'm using 
> > a non-hierarchical resource bundle name: "myresourcebundle")
> > 
> > * I've tried creating an explicit myresourcebundle_en_US.properties
> > 
> > The only thing that works is to comment out the 
> > ResourceBundle.getBundle(); line from my servlet.
> > 
> > I've looked at the generated JSP source code from Tomcat, 
> and they have 
> > the same ResourceBundle.getBundle(); as does my servlet.
> > 
> > Why can my JSP files find my resource bundle, yet my servlet can't?
> > 
> > Garret
> > 
> > P.S. I'm sure that this worked under Tomcat 4.x. Then 
> again, Tomcat 4.x 
> > didn't issue an error when my JSP files imported a class 
> but didn't use 
> > it, either.
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message