You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by muralidhar uttarkar <mu...@gmail.com> on 2012/03/11 07:26:22 UTC
Fwd: Action Class Not Found
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
Re: Action Class Not Found
Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/3/11 muralidhar uttarkar <mu...@gmail.com>:
> I want to know why do we need WAR file? Why should we use ANT build tool.?
It's up to you and how are you deploying application on production server
Regards
--
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Action Class Not Found
Posted by muralidhar uttarkar <mu...@gmail.com>.
Thanks for the information Dave
On Mon, Mar 12, 2012 at 1:17 AM, Dave Newton <da...@gmail.com> wrote:
> On Sun, Mar 11, 2012 at 6:33 AM, muralidhar uttarkar wrote:
>
> > I want to know why do we need WAR file? Why should we use ANT build
> tool.?
> >
>
> War files are the de facto web application deployment file.
>
> Ant allows repeatable, environment-independent builds (for developers
> regardless of their IDE, for a continuous integration server, etc.)
>
> Dave
>
Re: Action Class Not Found
Posted by Dave Newton <da...@gmail.com>.
On Sun, Mar 11, 2012 at 6:33 AM, muralidhar uttarkar wrote:
> I want to know why do we need WAR file? Why should we use ANT build tool.?
>
War files are the de facto web application deployment file.
Ant allows repeatable, environment-independent builds (for developers
regardless of their IDE, for a continuous integration server, etc.)
Dave
Re: Action Class Not Found
Posted by muralidhar uttarkar <mu...@gmail.com>.
It seems there is some problem with my ant build. I am getting that error
only If I generate WAR file with Ant Build tool. and then run that WAR on
server.
Otherwise, if I run the whole project as it is, It is running without any
error.
I want to know why do we need WAR file? Why should we use ANT build tool.?
On Sun, Mar 11, 2012 at 3:17 PM, Łukasz Lenart <lukasz.lenart@googlemail.com
> wrote:
> Check if class file is in the folder, try to use clean build
>
>
> file:/E:/murali/my%20office/New%20folder/Eclipse%20Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/abc/WEB-INF/classes/
>
>
> Regards
> --
> Łukasz http://www.lenart.org.pl/
> mobile +48 606 323 122, office +27 11 0838747
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: Action Class Not Found
Posted by Łukasz Lenart <lu...@googlemail.com>.
Check if class file is in the folder, try to use clean build
file:/E:/murali/my%20office/New%20folder/Eclipse%20Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/abc/WEB-INF/classes/
Regards
--
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org