Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 18117 invoked from network); 6 Sep 2004 20:19:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Sep 2004 20:19:24 -0000 Received: (qmail 72945 invoked by uid 500); 6 Sep 2004 20:18:35 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 72806 invoked by uid 500); 6 Sep 2004 20:18:34 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 72674 invoked by uid 99); 6 Sep 2004 20:18:30 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [67.154.139.115] (HELO starbug.mhsoftware.com) (67.154.139.115) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 06 Sep 2004 13:18:21 -0700 Received: from emp00 (c-67-164-162-42.client.comcast.net [67.164.162.42]) by starbug.mhsoftware.com (8.12.8/8.12.8) with ESMTP id i86KLpll028911 for ; Mon, 6 Sep 2004 14:21:51 -0600 Message-Id: <200409062021.i86KLpll028911@starbug.mhsoftware.com> From: "George Sexton" To: "'Tomcat Users List'" Subject: RE: missing resource bundle shouldn't be Date: Mon, 6 Sep 2004 14:18:02 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcSUOTLTy9bf+oCvT0G7SmbiEvKvEgAFU6ew In-Reply-To: <413CA103.3010908@globalmentor.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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: > > > > > > myservlet > > /myservlet/test > > > > > > 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