struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralidhar uttarkar <muralidharvish...@gmail.com>
Subject Fwd: Action Class Not Found
Date Sun, 11 Mar 2012 06:26:22 GMT
Hello All,

I am new to struts. I am trying learn struts from this below tutorial.
http://struts.apache.org/2.2.1/docs/getting-started.html
Request you to help me in solving this error.

I am using Eclipse Helios-SR1
Struts 2.2.3
JDK 1.6
Apache tomcat 7

My *index.jsp* looks like this.
<body style="background-color:#3D5C0A; color:white">

<s:form action="register">
<s:textfield  name="userBean.firstName" label="First name"/><br><br>
<s:textfield  name="userBean.lastName" label="Last name"/><br><br>
<s:textfield  name="userBean.email" label ="Email"/><br><br>
<s:textfield  name="userBean.emailConfirm" label ="Re-enter Email"/><br><br>
<s:password  name="userBean.password" label ="New Password"/><br><br>

<a href=""><font color="white">Why do I need to provide my
Birthday?</font></a><br><br>
<s:submit/>
</s:form>

</body>

*struts.xml*

<struts>

    <constant name="struts.devMode" value="true" />

    <package name="abc" extends="struts-default">
    <action name="index">
            <result>/index.jsp</result>
        </action>

    <action name="register"
class="com.socialapp.register.action.RegisterUser" method="execute">
          <result name="success">/thankyou.jsp</result>
    </action>


    </package>

</struts>

*Action class*
import com.socialapp.register.model.User;
import com.opensymphony.xwork2.ActionSupport;

public class RegisterUser extends ActionSupport {

    private static final long serialVersionUID = 1L;

    private User userBean;

    public String execute() throws Exception {

        return SUCCESS;
    }

    public User getUserBean() {

        return userBean;

    }

    public void setUserBean(User user) {

        userBean = user;

    }
}

*Model*

package com.socialapp.register.model;

public class User {

private String firstName;
private String lastName;
private String password;
private String email;
private String emailConfirm;

//getters and setters for all these variables.

}

*Web.xml*

  <filter>
    <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

I have added the below jars in my WEB-INF ->Lib


   1. commons-fileupload-1.2.2.jar
   2. commons-io-2.0.1.jar
   3. commons-lang-2.5.jar
   4. commons-logging-1.1.1.jar
   5. commons-logging-api.1.1.jar
   6. freemarker-2.3.16.jar
   7. ognl-3.0.1.jar
   8. struts2-core-2.2.3.jar
   9. xwork-core-2.3.3.jar
   10. javassist-3.11.0.GA.jar
   11. log4j-1.2.14.jar



With all these files when I run my WAR file in the server, am getting an
error.

Mar 11, 2012 11:31:13 AM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - action -
file:/E:/murali/my%20office/New%20folder/Eclipse%20Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/abc/WEB-INF/classes/struts.xml:15:94
.
.
.
.
.
Caused by: Action class [com.socialapp.register.action.RegisterUser] not
found - action -
file:/E:/murali/my%20office/New%20folder/Eclipse%20Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/abc/WEB-INF/classes/struts.xml:15:94

Thanks and Regards,

Muralidhar

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message