Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MissingResourceException

3 views
Skip to first unread message

Rich H

unread,
Dec 5, 2003, 10:08:52 AM12/5/03
to
I have a resource file named "LocalStrings.properties". In Apache Tomcat it
just had to be in the same folder as the .class files. Anyone know what I
have to do to make it work in WAS with my new .ear file?

Thanks in advance.

Rich

Todd Kaplinger

unread,
Dec 5, 2003, 10:12:53 AM12/5/03
to
It should work the same way as Tomcat. What is the exception you are
getting (stacktrace)?

Dexthor

unread,
Dec 5, 2003, 10:42:46 AM12/5/03
to
Place your file in the WEB-INF/classes folder.
if you are using Resource Bundle to read this file, try to place the file in
the same folder where you have your .class files.

Same applies to WAS too. You can always add the folder whereever you place
this file to the ApplicationServer classpath ( Command line args ). That way
class loader will find it for you.

HTH
Dexthor.

"Rich H" <mynew...@datasystemsintegration.com> wrote in message
news:bqq6un$4quu$1...@news.boulder.ibm.com...

Todd Kaplinger

unread,
Dec 5, 2003, 1:53:44 PM12/5/03
to
I would look at the installed WAR file to ensure the properties file
was picked up. If it is located inside of <WEB-INF>/classes, it should
work.

Rich Hajinlian wrote:
> Thanks for your help guys. I put my LocalStrings.properties in the same
> directory as my .class files. I rebuilt and restarted WAS and still got
> this. I am using the buildsamples build script for my project. I just
> changed the sample "TechnologySamples/SimpleServlet" project for my project.
> I believe the script basically creates an .ear file and installs it (my
> servlets work fine untill they try to use my LocalStrings.properties
> resource bundle). Do I have to include that into the build of the .ear
> file?
>
> Thanks for your help again.
>
> Rich
>
> Here is the stack.
>
> [12/5/03 13:33:15:898 EST] 79a7a47d WebGroup E SRVE0026E: [Servlet
> Error]-[movieInitCheckUser]: java.util.MissingResourceException: Can't find
> bundle for base name LocalStrings.properties, locale en_US
> at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:7
> 24)
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:695)
> at java.util.ResourceBundle.getBundle(ResourceBundle.java:571)
> at
> com.ibm.websphere.samples.movie.servlet.simpleservlet.greetingwar.movieInitC
> heckUser.doPost(movieInitCheckUser.java:25)


>
> "Rich H" <mynew...@datasystemsintegration.com> wrote in message
> news:bqq6un$4quu$1...@news.boulder.ibm.com...
>

Rich Hajinlian

unread,
Dec 5, 2003, 1:50:32 PM12/5/03
to
Thanks for your help guys. I put my LocalStrings.properties in the same
directory as my .class files. I rebuilt and restarted WAS and still got
this. I am using the buildsamples build script for my project. I just
changed the sample "TechnologySamples/SimpleServlet" project for my project.
I believe the script basically creates an .ear file and installs it (my
servlets work fine untill they try to use my LocalStrings.properties
resource bundle). Do I have to include that into the build of the .ear
file?

Thanks for your help again.

Rich

Here is the stack.

[12/5/03 13:33:15:898 EST] 79a7a47d WebGroup E SRVE0026E: [Servlet
Error]-[movieInitCheckUser]: java.util.MissingResourceException: Can't find
bundle for base name LocalStrings.properties, locale en_US
at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:7
24)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:695)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:571)
at
com.ibm.websphere.samples.movie.servlet.simpleservlet.greetingwar.movieInitC
heckUser.doPost(movieInitCheckUser.java:25)

"Rich H" <mynew...@datasystemsintegration.com> wrote in message
news:bqq6un$4quu$1...@news.boulder.ibm.com...

Rich Hajinlian

unread,
Dec 5, 2003, 2:36:49 PM12/5/03
to
Hi Todd,

Hmmmmmm did a jar -tf on my .ear file and it isn't being picked up and
included in there. I did put the LocalStrings.properties in my newly
created WEB-INF/classes directory under my build tree (which is the same as
the samples/TechnologySamples/SimpleServlet - which didn't have a classes
dir under WEB-INF) and rebuilt/reinstalled my app but...............

So. my LocalStrings.properties file is in (change the IBM supplied
samples/technologysamples directory with samples/movie tree)
[root@larry websphere]
#samples/movie/servlet/simpleservlet/greetingwar/LocalStrings.properties.

When I rebuild and examine the war file I see..... some stuff omitted
[root@larry samples]# jar -tf lib/Movie/Greeting.war
.
.
.
WEB-INF/classes/com/ibm/websphere/samples/movie/servlet/simpleservlet/greeti
ngwar/SimpleServlet.class
WEB-INF/classes/com/ibm/websphere/samples/movie/servlet/simpleservlet/greeti
ngwar/CheckedOut.class
.
.
.

No LocalStrings.properties! It should have been included with the .war
right? Is there any mods I have to make to the build.xml (again almost the
same as the samples included by IBM)?


Thanks again dude(s).

"Rich H" <mynew...@datasystemsintegration.com> wrote in message
news:bqq6un$4quu$1...@news.boulder.ibm.com...

Todd Kaplinger

unread,
Dec 5, 2003, 2:57:53 PM12/5/03
to
You should review the build script to see what is being packaged. it is
more than likely picking up just class files.

Rich Hajinlian

unread,
Dec 5, 2003, 3:06:07 PM12/5/03
to
Thanks again Todd,

Yes I noticed the PlantsByWebsphere project has a pbws.properties file. I
am examining the build.xml files for that project. I assume the
buildsamples script (that comes with WAS) would look in the build.xml files
to see what should be picked up since their Plants.... project seems to work
with the buildsamples script.

I'll RTFM(s) again to see what i'm missin.

Rich.

"Todd Kaplinger" <kapl...@alum.bentley.edu> wrote in message
news:3FD0E34...@alum.bentley.edu...

Rich Hajinlian

unread,
Dec 5, 2003, 6:56:08 PM12/5/03
to
Found it!

I had to put my property resource bundle file into a directory that is
pointed to WAS by going to the Admin Console and choosing Application
Servers/Process Definition/Java Virtual Machine/Classpath.

I put the bundle into all the WEB-INF directories for this application I
could find and did no good.

I'm sure there is a better way to do this but.............

Thanks for your help Todd.

Rich


"Rich H" <mynew...@datasystemsintegration.com> wrote in message
news:bqq6un$4quu$1...@news.boulder.ibm.com...

Rich Hajinlian

unread,
Dec 5, 2003, 8:15:36 PM12/5/03
to
Found it!

I put the .properties file into /opt/WebSphere/AppServer/properties
directory and wa-la.

Thanks all.


"Rich H" <mynew...@datasystemsintegration.com> wrote in message
news:bqq6un$4quu$1...@news.boulder.ibm.com...

0 new messages