velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony E. Carlos" <>
Subject Re: MessageResourcesTool: Message resources are not available.
Date Fri, 22 Oct 2004 05:49:25 GMT

Here's my web.xml:
   <!-- Standard Action Servlet Configuration (with debugging) -->

My resource file is in 
/WEB-INF/classes/resources/ What's weird is that 
I can access properties from within my Struts Action and set them into 
the request context and display them on the page with Velocity. Thus, I 
know that my resources file is correctly being accessed by Struts. As I 
said earlier, my whole setup was working until I changed my struts.jar 
file (from version 1.1 to 1.2.4).

Since you asked, here's the other part of web.xml:
<!-- Define Velocity template compiler -->

And part of my toolbox.xml:

I found the part of VelocityTools that created the message. It's from

      * Retrieves the specified {@link MessageResources} bundle, or the
      * application's default MessageResources if no bundle is specified.
      * @since VelocityTools 1.1
     protected MessageResources getResources(String bundle)
         if (bundle == null) // <---MUST BE NULL?
             if (resources == null) // <---MUST BE NULL?
                 Velocity.error("MessageResourcesTool: Message resources 
are not available.");
             return resources;

         MessageResources res =
             StrutsUtils.getMessageResources(request, application, 
         if (res == null)
             Velocity.error("MessageResourcesTool: MessageResources 
bundle '"
                            + bundle + "' is not available.");
         return res;

It looks like both the bundle and the resources are null. How can this 
be? Is it a bug or can I do something to ensure that both are not null?

Thanks for your help!


Hi Anthony,

 > I'm still having trouble using the ActionMessagesTool. However, I've
 > found some more info. In one of the log files, Velocity posts the
 > following error:
 > MessageResourcesTool: Message resources are not available.
Worked on my place.  Could you provide a bit more information?
- Where is your resource file?
- How are you configuring the resource file in your struts-config.xml?
- How are you configuring your ActionMessagesTool in toolbox.xml?

Best regards,
-- Shinobu Kawai

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message