aspose file tools*
The moose likes Struts and the fly likes No action instance for path /userRegistration could be created ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No action instance for path /userRegistration could be created ?" Watch "No action instance for path /userRegistration could be created ?" New topic
Author

No action instance for path /userRegistration could be created ?

harish pathak
Ranch Hand

Joined: Dec 17, 2005
Posts: 51
Hi All,

I am getting the following error:

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

No action instance for path /userRegistration could be created

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

stack trace is as:

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

va:268)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:50
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._cub._pod(.:521)
at com.evermind._cub._bmc(.:177)
at com.evermind._ax._ltc(.:666)
at com.evermind._ax._uab(.:191)
at com.evermind._bf.run(.:62)
Jan 19, 2006 2:43:03 PM org.apache.struts.util.RequestUtils createActionForm
SEVERE: Error creating form bean of class multipleform.UserRegistrationForm
java.lang.ClassNotFoundException: multipleform.UserRegistrationForm
at com.evermind._as.findClass(.:417)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.evermind._ib.loadClass(.:19)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.
a:207)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUti
java:231)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.
a:837)
at org.apache.struts.action.RequestProcessor.processActionForm(Reques
ocessor.java:364)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor
va:253)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:50
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._cub._pod(.:521)
at com.evermind._cub._bmc(.:177)
at com.evermind._ax._ltc(.:666)
at com.evermind._ax._uab(.:191)
at com.evermind._bf.run(.:62)
Jan 19, 2006 2:43:03 PM org.apache.struts.action.RequestProcessor processActi
reate
SEVERE: No action instance for path /userRegistration could be created
java.lang.ClassNotFoundException: multipleform.UserRegistrationAction
at com.evermind._as.findClass(.:417)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.evermind._ib.loadClass(.:19)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.
a:207)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUti
java:231)
at org.apache.struts.action.RequestProcessor.processActionCreate(Requ
Processor.java:326)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor
va:268)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:50
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind._cub._pod(.:521)
at com.evermind._cub._bmc(.:177)
at com.evermind._ax._ltc(.:666)
at com.evermind._ax._uab(.:191)
at com.evermind._bf.run(.:62)



--------------------------------------------------
following are my files and configuration..............

struts-config.xml is as:
------------------------------------------

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">


<struts-config>

<form-beans>
<form-bean name="userRegistrationForm" type="multipleform.UserRegistrationForm"/>
</form-beans>

<action-mappings>
<action path="/userRegistration"
type="multipleform.UserRegistrationAction"
name="userRegistrationForm"
scope="request"
input="/multipleform.jsp">
<forward name="success" path="/userregsuccess.html"/>
<forward name="failure" path="/userregfailure.html"/>
</action>
</action-mappings>

</struts-config>



------------------------------------------
jsp is as:
----------------------------------------------


<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<title>User Registration</title>
</head>
<h1>User Registration</h1>
<html:errors/>
<table>
<html:form action="/userRegistration.do">
<tr>
<td>
<bean:message key="userRegistration.firstName" />*
</td>
<td>
<html:text property="firstName" />
</td>
</tr>
<td>
<bean:message key="userRegistration.lastName" />*
</td>
<td>
<html:text property="lastName" />
</td>
<tr>
<td>
<bean:message key="userRegistration.userName" />*
</td>
<td>
<html:text property="userName" />
</td>
</tr>
<tr>
<td>
<bean:message key="userRegistration.email" />*
</td>
<td>
<html:text property="email" />
</td>
</tr>
<tr>
<td>
<bean:message key="userRegistration.phone" />
</td>
<td>
<html:text property="phone" />
</td>
</tr>
<tr>
<td>
<bean:message key="userRegistration.fax" />
</td>
<td>
<html:text property="fax" />
</td>
</tr>
<tr>
<td>
<bean:message key="userRegistration.password" />*
</td>
<td>
<html assword property="password" />
</td>
</tr>
<tr>
<td>
<bean:message key="userRegistration.password" />*
</td>
<td>
<html assword property="passwordCheck" />
</td>
</tr>
<tr>
<td>
<html:submit />
</td>
<td>
<html:cancel />
</td>
</tr>
</html:form>
</table>
</html>



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

ActionForm and ActionServlet (java file) is placed inside "multipleform" directory

Please look into the code and answer please.

Where I am doing wrong ?

Thanks

A beginner in struts...........

dnyan ginde
Ranch Hand

Joined: Jan 17, 2006
Posts: 68
hi,

I dont think you have placed the UserRegistrationAction in the multiform folder. Please check because the exception says that the Class UserRegistrationAction is not found.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Should this <html:form action="/userRegistration.do"> not be
<html:form action="/userRegistration">, since struts actually adds the ".do" when this tag is used.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
dnyan ginde
Ranch Hand

Joined: Jan 17, 2006
Posts: 68
There should'nt be a problem with using "/userRegistration.do".
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Originally posted by Bosun Bello:
Should this <html:form action="/userRegistration.do"> not be
<html:form action="/userRegistration">, since struts actually adds the ".do" when this tag is used.


Check <param-name> in web.xml

Like, I have:


and in struts-config.xml:



and call action from JSP:



You better check Rick's example for Lesson 1 on her site: http://www.learntechnology.net/

Bye,
Viki.


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
supreeth K S
Greenhorn

Joined: May 22, 2006
Posts: 1
Hi,

Check you action class extends DispatchAction and form class extends ActionForm.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It's a good idea to check the inheritance of your Action class. However it's Action you should be extending, not DispatchAction. Also check that you haven't overridden or made non-public the default no-args constructor of the Action class.


Merrill
Consultant, Sima Solutions
Moises Lejter
Greenhorn

Joined: Aug 10, 2006
Posts: 3
just wanted to mention that your suggestion was right on the money, when I just ran into this... I had made my constructor protected (cut and paste error :-) ) and I could not figure out why it would not work ...

Thank you!

Moises
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No action instance for path /userRegistration could be created ?