You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Digico <di...@home.com> on 2001/06/14 02:28:33 UTC

My app no longer loads message resources

My Struts 1.0b3 application is suddenly unable to use message resources that
I have defined.  They worked for me in the beginning but no longer do and I
can't figure out what might be causing the problem.  I get a "500" error
when I try to access a JSP that contains <bean:message.../> tags in it, with
the following exception message (first few lines only):

javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
	at
_0002fmainSearch_0002ejspmainSearch_jsp_11._jspService(_0002fmainSearch_0002
ejspmainSearch_jsp_11.java:404)


I've noticed that there are no messages from Tomcat in the console window at
startup indicating that resources have been loaded for this application, so
I'm pretty sure that something is getting overlooked on startup.  The
"ApplicationResources.properties" file is in the classes directory specified
by the "application" parameter for the action servlet in web.xml, just like
in other Struts apps (but with a different package name of course).

Any idea what might be going wrong?  Thx.

- Mark.


RE: My app no longer loads message resources

Posted by Digico <di...@home.com>.
Thanks Craig.  Everything was set up correctly, but you got me thinking
about the init method of the controller servlet.  I unfortunately ASSumed
that the ActionServlet overrode the init(ServletConfig) method and that the
no-parameter init() was free for the taking.  In fact, ActionServlet
overrides init(), so I just inserted a call to super.init() and wa-la!

- Mark.

> * Do you still have the <load-on-startup> element in your web.xml file
>   to cause the controller servlet to be loaded when the application is
>   initialized?  Without this, you'd get the error you encountered if the
>   very first request goes to a JSP page rather than an action.

Yes, in fact, I know the init method is running because
>
> * Do you have an <init-param> defining the correct location of the
>   application resources in your controller servlet definition?  Check the
>   Tomcat log file messages for clues (the controller servlet will complain
>   if it cannot load the application resources).
>
> Craig McClanahan


Re: My app no longer loads message resources

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 13 Jun 2001, Digico wrote:

> My Struts 1.0b3 application is suddenly unable to use message resources that
> I have defined.  They worked for me in the beginning but no longer do and I
> can't figure out what might be causing the problem.  I get a "500" error
> when I try to access a JSP that contains <bean:message.../> tags in it, with
> the following exception message (first few lines only):
> 
> javax.servlet.ServletException: Cannot find message resources under key
> org.apache.struts.action.MESSAGE
> 	at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:459)
> 	at
> _0002fmainSearch_0002ejspmainSearch_jsp_11._jspService(_0002fmainSearch_0002
> ejspmainSearch_jsp_11.java:404)
> 
> 
> I've noticed that there are no messages from Tomcat in the console window at
> startup indicating that resources have been loaded for this application, so
> I'm pretty sure that something is getting overlooked on startup.  The
> "ApplicationResources.properties" file is in the classes directory specified
> by the "application" parameter for the action servlet in web.xml, just like
> in other Struts apps (but with a different package name of course).
> 
> Any idea what might be going wrong?  Thx.
> 

Your suspicions about what's going on sound right on target.  Check for
the following:

* Do you still have the <load-on-startup> element in your web.xml file
  to cause the controller servlet to be loaded when the application is
  initialized?  Without this, you'd get the error you encountered if the
  very first request goes to a JSP page rather than an action.

* Do you have an <init-param> defining the correct location of the
  application resources in your controller servlet definition?  Check the
  Tomcat log file messages for clues (the controller servlet will complain
  if it cannot load the application resources).


> - Mark.
> 
> 

Craig McClanahan