*
The moose likes JSF and the fly likes Resourcebundle can not be found! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Resourcebundle can not be found!" Watch "Resourcebundle can not be found!" New topic
Author

Resourcebundle can not be found!

Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I am trying to use a resource bundle in my project. It is in a package in my classes folder.

I am trying to load it like this in my JSP page:
<f:loadBundle basename="com.zappware.publisher.web.Messages" var="Message" />

But the following error occurs:
ERROR [LoadBundleTag] Resource bundle 'com.zappware.publisher.web.Messages' could not be found.

The .properties file is in the war file in the WEB-INF/classes/... folder.

I have tried writing my own servlet that loads the resource bundle at that location and that works. Does anybody have a clue why JSF can not locate the resource bundle?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Make sure your properties files is located in the following location and that everything is correct spelling and case.

WEB-INF/classes/com/zappware/publisher/web/Messages.properties


GenRocket - Experts at Building Test Data
Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
I'm no JSF expert, but for me to get it to work in Struts, I have to associate this *.properties file in the struts-config.xml. So, I believe you neeed to associate your properties file with JSF either in JSF's configuration file (if any), in order for it to keep it up.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
It is in that location. If I load it using my own servlet I can read it perfectly at that location.

I am using JBOSS4.0.3RC1 which now has integrated support for JSF (using apache implementation) can it be possible that it is a classloading issue. Maybe because the JSF classes are at a different location they can not find my resource bundle?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

As Mike pointed out, do you have your resource bundle defined in your faces-config?
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
I don't have to declare resource bundles in the faces-config file. Using RI though.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I have some reference to it. It does not help me (I can leave it out and I still get the same problem).


<faces-config>
<application>
<message-bundle>com.zappware.publisher.web.Messages</message-bundle>
</application>
<navigation-rule>
....

I'm currently trying to find out what this means exactly. I don't really see the point of doing this without being able to map it to something.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
I fixed it.

It was a classloading issue. I now included the apache jsf implementation jar file in my WAR file (the same version that is supplied with jboss) and it works.

Things like this make me want to become a gardener.
[ August 30, 2005: Message edited by: Manuel Moons ]
rahul khanna
Ranch Hand

Joined: Sep 14, 2005
Posts: 48
can u please tel the specific name of the jar..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resourcebundle can not be found!
 
Similar Threads
specifying different resource bundle in validation.xml
how to create our own wbapplication
Unable to access Property file
Resource Bundle
setting classpath