aspose file tools*
The moose likes Struts and the fly likes org.apache.jasper.JasperException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "org.apache.jasper.JasperException" Watch "org.apache.jasper.JasperException" New topic
Author

org.apache.jasper.JasperException

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1032
here is my Address.jsp


here is my web.xml


here is my config.xml


then here is my error when i am going to call Address.do.but it is working for loadContactForm.do
[code]
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/Address.jsp at line 8

5:
6: <head>
7:
8: <title><bean:message key="welcome.title"/></title>
9:
10: <html:base/>
11:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:397)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.pages.Address_jsp._jspService(Address_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1189)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:1038)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
org.apache.jsp.pages.Address_jsp._jspx_meth_bean_005fmessage_005f0(Address_jsp.java:156)
org.apache.jsp.pages.Address_jsp._jspx_meth_html_005fhtml_005f0(Address_jsp.java:114)
org.apache.jsp.pages.Address_jsp._jspService(Address_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:988)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.


--------------------------------------------------------------------------------

JBossWeb/2.0.1.GA
[code]
venkat nadikattu
Greenhorn

Joined: Jun 24, 2009
Posts: 8
i think it is failing to load the resource bundle file
can you post the struts-config.xml file
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1032
here is my web.xml file


here is my struts-config.xml file

venkat nadikattu
Greenhorn

Joined: Jun 24, 2009
Posts: 8
HI,
you need add the below tag in strugs-config.xml file

<message-resources parameter="webuiresoueces" />

here "webuiresoueces" resource bundle name where you keep all the message (key,value) and this file


since you are using <title><bean:message key="welcome.title"/></title>
the "welcome.title" key should be there in that file
sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1032
i am not familer with message resource tag.can you send me the code what should i add in struct-config.xml.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

He did.
venkat nadikattu
Greenhorn

Joined: Jun 24, 2009
Posts: 8
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>


<form-beans>
<form-bean
name="AddressForm"
type="roseindia.net.AddressForm"/>
</form-beans>

<action-mappings>
<action path="/loadContactForm" forward="/contactDetails.jsp" />

<action path="/confirmRegistration"
type="my.ContactAction" scope="request"
validate="false">
<forward name="success" path="/success.jsp" />
</action>


<action
path="/Address"
type="roseindia.net.AddressAction"
name="AddressForm"
scope="request"
validate="true"
input="/pages/Address.jsp">
<forward name="success" path="/pages/success.jsp"/>
</action>



</action-mappings>
<message-resources parameter="resource" />


</struts-config>



use the above struts config.xml file and
create "resource.properties" file
and add the messages key=value into this file and keep this file in classpath
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.apache.jasper.JasperException
 
Similar Threads
Validation error
Probelom in Manual Validation method
No getter method for property:
Action Message error
NullPointerException on tiles