This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Error in Struts Application(Cannot find message resources under key org.apache.strut)  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am fighting with this error from last 2 days ,
I try all the things.
i am pasting the stackTrace .
javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.PgInput_jsp._jspService(PgInput_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


root cause

javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.struts.util.RequestUtils.retrieveMessageResources(RequestUtils.java:1103)
org.apache.struts.util.RequestUtils.message(RequestUtils.java:1043)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:294)
org.apache.jsp.PgInput_jsp._jspx_meth_bean_message_0(PgInput_jsp.java:138)
org.apache.jsp.PgInput_jsp._jspx_meth_html_html_0(PgInput_jsp.java:108)
org.apache.jsp.PgInput_jsp._jspService(PgInput_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


my web.xml file is --->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Struts ExampleWeb</display-name>

<servlet>
<servlet-name>CewolfServlet</servlet-name>
<servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
<!-- sets storage implementation -->
<init-param>
<param-name>storage</param-name>
<param-value>de.laures.cewolf.storage.TransientSessionStorage</param-value>
</init-param>
<!-- sets overlib.js location relative to webapp -->
<init-param>
<param-name>overliburl</param-name>
<param-value>etc/overlib.js</param-value>
</init-param>
<!-- turn on or off debugging logging -->
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>



<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>org.struts.example.strutsexample</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>

<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>CewolfServlet</servlet-name>
<url-pattern>/cewolf/*</url-pattern>
</servlet-mapping>



<session-config>
<session-timeout>600</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>




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

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

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

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

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

<taglib>
<taglib-uri>WEB-INF/tlds/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>

</web-app>


my struts-config.xml is------------>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">


<struts-config>

<!-------Form Bean Definition-------------->



<form-beans>

<form-bean name=""StrutsInputFormBean type="org.struts.example.StrutsInputForm" />

<form-bean name=StrutsDisplayFormBean type="org.struts.example.StrutsDisplayForm" />

</form-beans>
<!------------
<global-exceptions>
<exception
key="global.error.invalidlogin"
path="/login.jsp"
scope="request"
type="com.quest.bts.service.InvalidLoginException"/>
</global-exceptions>
---------------------->
<!--------=============Global Forward Definition===============--------------->
<global-forwards>
<forward name="Menu" path="/index.html" />

</global-forwards>

<!----------=================Action Mapping Definition=======================---------->

<action-mappings>
<action path="/StrutsInputPath"
type="org.struts.example.StrutsInputAction"
name="StrutsInputFormBean"
scope="request"
input="/PgInput.jsp"
validate="true">

<forward name="next" path="/PgDisplay.jsp" />
</action>

<action path="/StrutsDisplayPath"
type="org.struts.example.StrutsDisplayAction"
name="StrutsDisplayFormBean"
scope="request"
input="/PgDisplay.jsp">

</action>

</action-mappings>

<message-resources parameter="strutsexample"/>
<message-resources parameter="ISOCodeRes" key="ISOCodeRes"/>

<plug-in className="net.sf.navigator.menu.MenuPlugIn">
<set-property property="menuConfig" value="/WEB-INF/menu-config.xml"/>
</plug-in>

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>


</struts-config>

i put each and every thing at the right place , but i dont know you it is showing error,plzz help me to solve this problem
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to struts, so bare with me. I think the problem may be the following:


You have 2 message resource bundles declared, one assigned to the key "ISOCodesRes" and the other to the default key "org.apache.struts.action.MESSAGE".

I believe struts cannot find the following resource bundle:
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check strutsexample.properties is saved in WEB-INF/classes
 
Shaikh Riyaz
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all Thanx for your reply,
But tryed all the thing.
I put only one <message-resources parameter="strutsexample.properties"/>
even then it is showing the same error.
i am pasting my .properties file plz check it ,and it is located in WEB-INF/classes folder .just tell me how to put resource file in a classpath.


this is strutsexample.properties


strutsexample.title1=Struts Example Project - Input Form
strutsexample.title2=Struts Example Project - Display Page
strutsexample.name=Enter your Name
strutsexample.address=Enter your Address
strutsexample.city=Enter your City
strutsexample.state=Enter your State
strutsexample.zipcode=Enter your ZipCode

error.name.required=<li>You must enter your Name</li>
error.address.required=<li>You must enter your address</li>
error.city.required=<li>You must Enter your City</li>
error.state.required=<li>You must Enter your City</li>
error.zipcode.required=<li>You Must Enter your ZipCode</li>
error.action.required=<li>You must click on the next button</li>
errors.header=
errors.footer=
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!