Struts messagresources problem

Discussion in 'Java' started by TDOR, Jul 13, 2005.

  1. TDOR

    TDOR Guest

    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(SecureClassLoader.java:124)
    at com.evermind.util.OC4JSecureClassLoader.defineClassEntry(OC4JSecureClassLoader.java:172)
    at oracle.jsp.runtimev2.JspClassLoader.loadClass(JspClassLoader.java:744)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at oracle.jsp.runtimev2.JspPageInfo.getInstFacade(JspPageInfo.java:167)
    at oracle.jsp.runtimev2.JspPageTable.getInstFacade(JspPageTable.java:473)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.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.doForward(RequestProcessor.java:1069)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
    at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
    at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345)
    at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.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.processRequest(HttpRequestHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java: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?
    TDOR, Jul 13, 2005
    #1
    1. Advertising

  2. TDOR

    Wendy Smoak Guest

    "TDOR" <> 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
    Wendy Smoak, Jul 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Katie Wright
    Replies:
    8
    Views:
    4,238
    Andrea Desole
    Jan 7, 2005
  2. Jason Us
    Replies:
    0
    Views:
    984
    Jason Us
    Oct 4, 2003
  3. jc1771
    Replies:
    0
    Views:
    399
    jc1771
    Dec 28, 2003
  4. sin
    Replies:
    3
    Views:
    721
    Sudsy
    Feb 22, 2004
  5. Aleksandar Matijaca
    Replies:
    2
    Views:
    8,311
    Aleksandar Matijaca
    Sep 19, 2004
Loading...

Share This Page