Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No action instance for path /userRegistration could be created ?

 
harish pathak
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should this <html:form action="/userRegistration.do"> not be
<html:form action="/userRegistration">, since struts actually adds the ".do" when this tag is used.
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should'nt be a problem with using "/userRegistration.do".
 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
supreeth K S
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check you action class extends DispatchAction and form class extends ActionForm.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Moises Lejter
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic