You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "G.L. Grobe" <ga...@grobe.org> on 2001/03/03 10:27:01 UTC

Cannot find message resources under key org.apache.struts.action.MESSAGE

Just started learning struts. I'm using orion server 1.4.5. I've got the
struts.jar in my ~/WEB-INF/lib dir and have listed the taglibs in the
~/WEB-INF/web.xml file as well as included all the *.tld in this same dir.
  <taglib>
      <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
   </taglib>

   <taglib>
      <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
   </taglib>
...

When running the following page, I get the error list down below:
I've also got a file called 'myProps.properties' packaged under the
~/WEB-INF/classes/com.mydir1/mydir2/resources dir.

-------- index.jsp -----------------------------------
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>
<head>
<title>
   <bean:message key="main.title" />
</title>
</head>

<body>
<html:errors />

This is a atest.
</body>
</html:html>

----------- error output -------------------------

500 Internal Server Error
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE at
org.apache.struts.util.RequestUtils.message(RequestUtils.java, Compiled
Code) at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java,
Compiled Code) at /index.jsp._jspService(/index.jsp.java, Compiled Code) at
com.orionserver.http.OrionHttpJspPage.service(JAX, Compiled Code) at
com.evermind.server.http.HttpApplication.xj(JAX, Compiled Code) at
com.evermind.server.http.JSPServlet.service(JAX, Compiled Code) at
com.evermind.server.http.d3.sw(JAX, Compiled Code) at
com.evermind.server.http.d3.su(JAX, Compiled Code) at
com.evermind.server.http.ef.s1(JAX, Compiled Code) at
com.evermind.server.http.ef.do(JAX, Compiled Code) at
com.evermind.util.f.run(JAX, Compiled Code)


Any help much appreciated.


Re: Cannot find message resources under key org.apache.struts.action.MESSAGE

Posted by Ben Souther <bs...@redtrain.com>.
I just went through the same thing.  The workaround listed in the Struts
installation guide won't work either.
This is what I did to fix it:

Go to struts.jar (You may find more than one copy of this on your machine. The
one that you want will be in
$STRUTS_HOME/webapps/struts-example/WEB-INF/lib/    providing that you are
trying to use the struts example)

Remove the file : struts-config_1_0.dtd.

Put this file in:  $STRUTS-HOME/webapps/struts-example/WEB-INF

NOTE: I also put it in $STRUTS-HOME/webapps/struts-example.  I'm not sure
which location is really working. You may want to put it in both places until
you get things up and running.

That should do it.

It is important that you remove the dtd file from the jar. Don't just copy
into the other directories.




"G.L. Grobe" wrote:

> Just started learning struts. I'm using orion server 1.4.5. I've got the
> struts.jar in my ~/WEB-INF/lib dir and have listed the taglibs in the
> ~/WEB-INF/web.xml file as well as included all the *.tld in this same dir.
>   <taglib>
>       <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
>       <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>    </taglib>
>
>    <taglib>
>       <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
>       <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>    </taglib>
> ...
>
> When running the following page, I get the error list down below:
> I've also got a file called 'myProps.properties' packaged under the
> ~/WEB-INF/classes/com.mydir1/mydir2/resources dir.
>
> -------- index.jsp -----------------------------------
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <html:html>
> <head>
> <title>
>    <bean:message key="main.title" />
> </title>
> </head>
>
> <body>
> <html:errors />
>
> This is a atest.
> </body>
> </html:html>
>
> ----------- error output -------------------------
>
> 500 Internal Server Error
> javax.servlet.jsp.JspException: Cannot find message resources under key
> org.apache.struts.action.MESSAGE at
> org.apache.struts.util.RequestUtils.message(RequestUtils.java, Compiled
> Code) at
> org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java,
> Compiled Code) at /index.jsp._jspService(/index.jsp.java, Compiled Code) at
> com.orionserver.http.OrionHttpJspPage.service(JAX, Compiled Code) at
> com.evermind.server.http.HttpApplication.xj(JAX, Compiled Code) at
> com.evermind.server.http.JSPServlet.service(JAX, Compiled Code) at
> com.evermind.server.http.d3.sw(JAX, Compiled Code) at
> com.evermind.server.http.d3.su(JAX, Compiled Code) at
> com.evermind.server.http.ef.s1(JAX, Compiled Code) at
> com.evermind.server.http.ef.do(JAX, Compiled Code) at
> com.evermind.util.f.run(JAX, Compiled Code)
>
> Any help much appreciated.


Re: Cannot find message resources under key org.apache.struts.action.MESSAGE

Posted by "G.L. Grobe" <ga...@grobe.org>.
Yes, I did that.

----- Original Message -----
From: "Niall Pemberton" <ni...@btInternet.com>
To: <st...@jakarta.apache.org>
Sent: Sunday, March 04, 2001 10:39 AM
Subject: RE: Cannot find message resources under key
org.apache.struts.action.MESSAGE


> Have you defined an initialization parameter for the resource bundle?
>
> >From the User Guide:
> -------------------
>
> When you configue the controller servlet in the web application deployment
> descriptor, one of the things you will need to define in an initialization
> parameter is the base name of the resource bundle for the application. In
> the case described above, it would be com.mycompany.mypackage.MyResources.
>
> <servlet>
>   <servlet-name>action</servlet-name>
>   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>   <init-param>
>     <param-name>application</param-name>
>     <param-value>com.mycompany.mypackage.MyResources</param-value>
>   </init-param>
>   <.../>
> </servlet>
>
> The important thing is for the resource bundle to be found on the class
path
> for your application.
>
> > From: G.L. Grobe [mailto:gary@grobe.org]
> > Subject: Cannot find message resources under key
> org.apache.struts.action.MESSAGE
> >
> >
> > Just started learning struts. I'm using orion server 1.4.5. I've got the
> > struts.jar in my ~/WEB-INF/lib dir and have listed the taglibs in the
> > ~/WEB-INF/web.xml file as well as included all the *.tld in this same
dir.
> >   <taglib>
> >       <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
> >       <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
> >    </taglib>
> >
> >    <taglib>
> >       <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
> >       <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
> >    </taglib>
> > ...
> >
> > When running the following page, I get the error list down below:
> > I've also got a file called 'myProps.properties' packaged under the
> > ~/WEB-INF/classes/com.mydir1/mydir2/resources dir.
> >
> > -------- index.jsp -----------------------------------
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> >
> > <html:html>
> > <head>
> > <title>
> >    <bean:message key="main.title" />
> > </title>
> > </head>
> >
> > <body>
> > <html:errors />
> >
> > This is a atest.
> > </body>
> > </html:html>
> >
> > ----------- error output -------------------------
> >
> > 500 Internal Server Error
> > javax.servlet.jsp.JspException: Cannot find message resources under key
> > org.apache.struts.action.MESSAGE at
> > org.apache.struts.util.RequestUtils.message(RequestUtils.java, Compiled
> > Code) at
> > org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java,
> > Compiled Code) at /index.jsp._jspService(/index.jsp.java,
> > Compiled Code) at
> > com.orionserver.http.OrionHttpJspPage.service(JAX, Compiled Code) at
> > com.evermind.server.http.HttpApplication.xj(JAX, Compiled Code) at
> > com.evermind.server.http.JSPServlet.service(JAX, Compiled Code) at
> > com.evermind.server.http.d3.sw(JAX, Compiled Code) at
> > com.evermind.server.http.d3.su(JAX, Compiled Code) at
> > com.evermind.server.http.ef.s1(JAX, Compiled Code) at
> > com.evermind.server.http.ef.do(JAX, Compiled Code) at
> > com.evermind.util.f.run(JAX, Compiled Code)
> >
> >
> > Any help much appreciated.
> >
> >
>


RE: Cannot find message resources under key org.apache.struts.action.MESSAGE

Posted by Niall Pemberton <ni...@btInternet.com>.
Have you defined an initialization parameter for the resource bundle?