Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts messagresources problem

Reply
Thread Tools

Struts messagresources problem

 
 
TDOR
Guest
Posts: n/a
 
      07-13-2005
I add this line to my Form class in its validate method:

actionErrors.add("Name", new ActionMessage("errors.invalid"));

Pressing the submit button on the page that trigger the validation
I now get an exception (it got no exception before adding the above
line):

java.lang.NoClassDefFoundError: _page/_ProjectProperties (wrong name:
_page/_Projectproperties)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :620)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at com.evermind.util.OC4JSecureClassLoader.defineClas sEntry(OC4JSecureClassLoader.java:172)
at oracle.jsp.runtimev2.JspClassLoader.loadClass(JspC lassLoader.java:744)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at oracle.jsp.runtimev2.JspPageInfo.getInstFacade(Jsp PageInfo.java:167)
at oracle.jsp.runtimev2.JspPageTable.getInstFacade(Js pPageTable.java:473)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageT able.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(Js pServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet .java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at com.evermind.server.http.ServletRequestDispatcher. invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.ServletRequestDispatcher. forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doFo rward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.internal ModuleRelativeForward(RequestProcessor.java:1012)
at org.apache.struts.tiles.TilesRequestProcessor.inte rnalModuleRelativeForward(TilesRequestProcessor.ja va:345)
at org.apache.struts.action.RequestProcessor.processV alidate(RequestProcessor.java:980)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at com.evermind.server.http.ServletRequestDispatcher. invoke(ServletRequestDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.proces sRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(Ht tpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor $MyWorker.run(ReleasableResourcePooledExecutor.jav a:192)
at java.lang.Thread.run(Thread.java:595)


Theese are my action mappings:

<action-mappings>
<action name="ProjectPropertiesForm"
path="/projectpropertiessubmit" input="/page/ProjectProperties.jsp"
type="timesheet.ProjectPropertiesAction" scope="request"
validate="true" unknown="false">
<forward name="success" path="/welcome.do"/>
<forward name="failure" path="/page/ProjectProperties.jsp"/>
</action>
<action path="/projectproperties"
forward="/page/Projectproperties.jsp" unknown="false"/>
<action path="/welcome" forward="/page/Welcome.jsp"
unknown="true"/>
</action-mappings>

Im using the struts-blank sample from struts 1.2.7. The
MessageResources.properties file is located under web-inf/classes.
The page with the submit button contains a <html:errors/> tag.
Any1 know what im doing wrong?
 
Reply With Quote
 
 
 
 
Wendy Smoak
Guest
Posts: n/a
 
      07-13-2005
"TDOR" <(E-Mail Removed)> wrote:

> I add this line to my Form class in its validate method:
> actionErrors.add("Name", new ActionMessage("errors.invalid"));
>
> Pressing the submit button on the page that trigger the validation
> I now get an exception (it got no exception before adding the above
> line):
>
> java.lang.NoClassDefFoundError: _page/_ProjectProperties (wrong name:
> _page/_Projectproperties)


No idea why adding an error is provoking it, but the problem is that you
have ProjectProperties in some places and Projectproperties in others (note
the capitalization). I bet you're on Windows, which is normally not case
sensitive, but the Servlet container *is*.

> <action name="ProjectPropertiesForm"
> path="/projectpropertiessubmit" input="/page/ProjectProperties.jsp"

....
> <forward name="failure" path="/page/ProjectProperties.jsp"/>

....
> forward="/page/Projectproperties.jsp" unknown="false"/>


I assume you don't really have BOTH a Projectproperties.jsp and a
ProjectProperties.jsp. Pick one, fix all the instances of that name, and
then (this is important) stop the container and clean out the work directory
to get rid of all of the generated and compiled JSP code for this webapp.

--
Wendy Smoak


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
Tomcat 5.028 Struts problem - struts-config.xml does not start with a "/" character Aleksandar Matijaca Java 2 09-19-2004 03:52 PM
[Struts]output javascript in struts perform() sin Java 3 02-22-2004 08:27 AM
Integrate a Struts app with a non-struts app jc1771 Java 0 12-28-2003 06:36 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM



Advertisments