You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dean Hiller <de...@xsoftware.biz> on 2004/10/10 06:07:41 UTC
org.apache.struts.action.MESSAGE not found??
I saw one long posting on this in the archives with no clear answer. Someone had the exact same problem. For some reason PageContextImpl is looking for a key I never defined and don't have in any of my jsp's. Relevant stack trace is below...
I believe this is the only relevant part of the stack trace...
javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
Line 95 of the index_jsp is having trouble. Here are the lines in the generated index_jsp file from tomcat....
91 } catch (Throwable t) {
92 out = _jspx_out;
93 if (out != null && out.getBufferSize() != 0)
94 out.clearBuffer();
95 if (pageContext != null) pageContext.handlePageException(t);
96 } finally {
97 if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
98 }
Notice the root cause of the real exception caught by line 91 is hidden by the exception coming from line 95. (ie. I need to fix 95 and them I am off on my own fixing my next problem. I really need to fix this one as I need the errors my apps cause to be reported correctly. Anybody have any ideas on this?
thanks,
dean
Re: org.apache.struts.action.MESSAGE not found??
Posted by Dean Hiller <de...@xsoftware.biz>.
thanks much. serves me right for using an outdated book.
thanks,
dean
----- Original Message -----
From: "Rick Reumann" <st...@reumann.net>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Sunday, October 10, 2004 9:35 PM
Subject: Re: org.apache.struts.action.MESSAGE not found??
> Dean Hiller wrote the following on 10/10/2004 11:06 PM:
>
> > I have found out it appears struts is not loading my resource file in
time
> > for the properties to be read from it or something like that. Does
anyone
> > have any ideas? My struts-config.xml file has this in it....
> > <servlet>
> > <servlet-name>action</servlet-name>
> > <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> > <init-param>
> > <param-name>config</param-name>
> > <param-value>/WEB-INF/struts-config.xml</param-value>
> > </init-param>
> > <init-param>
> > <param-name>application</param-name>
> > <param-value>ApplicationResources</param-value>
> > </init-param>
> > <load-on-startup>1</load-on-startup>
> > </servlet>
>
> That's your web.xml. The web.xml part for struts only needs
>
>
> <servlet-name>action</servlet-name>
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> Then at the bottom of your struts-config you need your resources
definition:
>
> <message-resources parameter="ApplicationResources" null="false"/>
>
>
> The sample application with Struts shows all of this. Just follow their
> web.xml and struts-config examples.
>
> --
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: org.apache.struts.action.MESSAGE not found??
Posted by Rick Reumann <st...@reumann.net>.
Dean Hiller wrote the following on 10/10/2004 11:06 PM:
> I have found out it appears struts is not loading my resource file in time
> for the properties to be read from it or something like that. Does anyone
> have any ideas? My struts-config.xml file has this in it....
> <servlet>
> <servlet-name>action</servlet-name>
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>application</param-name>
> <param-value>ApplicationResources</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
That's your web.xml. The web.xml part for struts only needs
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
Then at the bottom of your struts-config you need your resources definition:
<message-resources parameter="ApplicationResources" null="false"/>
The sample application with Struts shows all of this. Just follow their
web.xml and struts-config examples.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: org.apache.struts.action.MESSAGE not found??
Posted by Dean Hiller <de...@xsoftware.biz>.
Well, it turns out tomcat 5 is fixed giving me the true stack trace which as
suspected is coming out of struts.
I have found out it appears struts is not loading my resource file in time
for the properties to be read from it or something like that. Does anyone
have any ideas? My struts-config.xml file has this in it....
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
More details follow of the precise problem...
thanks,
dean
The relevant part of the stack trace is
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:123
3)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:1082)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:226)
org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:186)
Looking at line 186 of index_jsp.java tells me it is looking up app.symbol
which is defined correctly.
The code of TagUtils looks like so....
1232 if (resources == null) {
1233 JspException e =
1234 new
JspException(messages.getMessage("message.bundle", bundle));
1235 saveException(pageContext, e);
1236 throw e;
1237 }
So somehow my resources is null. resources is only set if checkPageScope is
true though which I find kind of weird.
thanks for any help on this,
dean
----- Original Message -----
From: "Dean Hiller" <de...@xsoftware.biz>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Saturday, October 09, 2004 10:42 PM
Subject: Re: org.apache.struts.action.MESSAGE not found??
> more info....This doesn't seem too good and I should probably post to the
> tomcat list on this
>
> Looking at PageContextImpl, it has hidden another exception I believe.
> 521 } else {
> 522 // Otherwise throw the exception wrapped inside a
> ServletException.
> 523 // Set the exception as the root cause in the ServletException
> 524 // to get a stack trace for the real problem
> 525 if (t instanceof IOException) throw (IOException)t;
> 526 if (t instanceof ServletException) throw (ServletException)t;
> 527 if (t instanceof RuntimeException) throw
(RuntimeException)t;
> 528 if (t instanceof JspException) {
> 529 Throwable rootCause = ((JspException)t).getRootCause();
> 530 if (rootCause != null) {
> 531 throw new ServletException(t.getMessage(),
> rootCause);
> 532 } else {
> 533 throw new ServletException(t);
> 534 }
> 535 }
> 536 throw new ServletException(t);
> 537 }
>
> Notice stack trace below says line 533. This line is passed an exception
I
> do want to know about, but the root cause is supposedly that
> ServletException, which is a mistake. The root cause is "t" or if t is
> chained further, something that caused 't'. Don't suppose anyone knows
this
> one?
> thanks,
> dean
>
>
>
>
> ----- Original Message -----
> From: "Dean Hiller" <de...@xsoftware.biz>
> To: <us...@struts.apache.org>
> Sent: Saturday, October 09, 2004 10:07 PM
> Subject: org.apache.struts.action.MESSAGE not found??
>
>
> I saw one long posting on this in the archives with no clear answer.
> Someone had the exact same problem. For some reason PageContextImpl is
> looking for a key I never defined and don't have in any of my jsp's.
> Relevant stack trace is below...
>
> I believe this is the only relevant part of the stack trace...
> javax.servlet.ServletException: Cannot find message resources under key
> org.apache.struts.action.MESSAGE
> at
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:533)
> at org.apache.jsp.index_jsp._jspService(index_jsp.java:95)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> Line 95 of the index_jsp is having trouble. Here are the lines in the
> generated index_jsp file from tomcat....
>
> 91 } catch (Throwable t) {
> 92 out = _jspx_out;
> 93 if (out != null && out.getBufferSize() != 0)
> 94 out.clearBuffer();
> 95 if (pageContext != null) pageContext.handlePageException(t);
> 96 } finally {
> 97 if (_jspxFactory != null)
> _jspxFactory.releasePageContext(pageContext);
> 98 }
>
> Notice the root cause of the real exception caught by line 91 is hidden by
> the exception coming from line 95. (ie. I need to fix 95 and them I am
off
> on my own fixing my next problem. I really need to fix this one as I need
> the errors my apps cause to be reported correctly. Anybody have any ideas
> on this?
> thanks,
> dean
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: org.apache.struts.action.MESSAGE not found??
Posted by Dean Hiller <de...@xsoftware.biz>.
more info....This doesn't seem too good and I should probably post to the
tomcat list on this
Looking at PageContextImpl, it has hidden another exception I believe.
521 } else {
522 // Otherwise throw the exception wrapped inside a
ServletException.
523 // Set the exception as the root cause in the ServletException
524 // to get a stack trace for the real problem
525 if (t instanceof IOException) throw (IOException)t;
526 if (t instanceof ServletException) throw (ServletException)t;
527 if (t instanceof RuntimeException) throw (RuntimeException)t;
528 if (t instanceof JspException) {
529 Throwable rootCause = ((JspException)t).getRootCause();
530 if (rootCause != null) {
531 throw new ServletException(t.getMessage(),
rootCause);
532 } else {
533 throw new ServletException(t);
534 }
535 }
536 throw new ServletException(t);
537 }
Notice stack trace below says line 533. This line is passed an exception I
do want to know about, but the root cause is supposedly that
ServletException, which is a mistake. The root cause is "t" or if t is
chained further, something that caused 't'. Don't suppose anyone knows this
one?
thanks,
dean
----- Original Message -----
From: "Dean Hiller" <de...@xsoftware.biz>
To: <us...@struts.apache.org>
Sent: Saturday, October 09, 2004 10:07 PM
Subject: org.apache.struts.action.MESSAGE not found??
I saw one long posting on this in the archives with no clear answer.
Someone had the exact same problem. For some reason PageContextImpl is
looking for a key I never defined and don't have in any of my jsp's.
Relevant stack trace is below...
I believe this is the only relevant part of the stack trace...
javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:533)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
Line 95 of the index_jsp is having trouble. Here are the lines in the
generated index_jsp file from tomcat....
91 } catch (Throwable t) {
92 out = _jspx_out;
93 if (out != null && out.getBufferSize() != 0)
94 out.clearBuffer();
95 if (pageContext != null) pageContext.handlePageException(t);
96 } finally {
97 if (_jspxFactory != null)
_jspxFactory.releasePageContext(pageContext);
98 }
Notice the root cause of the real exception caught by line 91 is hidden by
the exception coming from line 95. (ie. I need to fix 95 and them I am off
on my own fixing my next problem. I really need to fix this one as I need
the errors my apps cause to be reported correctly. Anybody have any ideas
on this?
thanks,
dean
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
One jsp File for all Errors(Exceptions) ?
Posted by Manuel Wissmann <Ma...@gmx.de>.
Hi All!
Is there a easy way in Struts to use one jsp-file to display all
Errors(Exceptions) which occour?
Thx Manu
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org