File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resourcebundle can not be found!

 
Manuel Moons
Ranch Hand
Posts: 229
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Choon-Chern Lim
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Mike pointed out, do you have your resource bundle defined in your faces-config?
 
seb petterson
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have to declare resource bundles in the faces-config file. Using RI though.
 
Manuel Moons
Ranch Hand
Posts: 229
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u please tel the specific name of the jar..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic