This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internal Server Error :Cannot find ActionMappings or ActionFormBeans collection

 
Ram Krishna
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to Configure Tomcat 4.0 with Struts.
The Error was
Apache Tomcat/4.0.2 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
Exception :
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:247)
......................

Root Cause :
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:773)
...............

Can any one help
 
arpsriv
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a same problem as posted by you. My JSP with Tomcat are giving me tough time.
I would request if you have a solution for:
"javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection"
Would appriciate your reply.
Regards.
Anurag
 
Chad McGowan
Ranch Hand
Posts: 265
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the google search found a thread with the exact problem i am having... but unfortunately there is no answer.
I have tried to run struts on tomcat 4.1.12 and get the same exception listed above.
Has anyone had this problem and then solved it?
Thanks.
 
Bharat Varma
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing the same problem.Any help would be appreciated.
Thanks,
-Bharat
 
ravindran shanmugam
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem happens when the server is not able to find mapping for the parameter you are passing as action.
for ex. if your JSP has

your struts-config.xml should have mapping for action parameter i.e. "/login"
something like

and you should have Action (LoginAction) and ActionForm (LoginFormBean) inside WEB-INF/classes folder.
Even after doing this if you are not getting the page try to
give a mapping for login page in struts-config.xml like this

and forward the request to login page from LoginAction.

in the browser call login.do instead of login.jsp
( i.e. here you are calling the Action class which forwards the request to JSP )
- Ravindran.
 
Jerry Liu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had similar problem when I used Tomcat 4.1.12, Apache Struts 1.1 w/ JDK 1.4.1 -- It has been very frustrating to figure out the root cause of this error -- my problem was fixed when I changed JRE that runs Tomcat back to 1.3.1_06.
[ January 28, 2003: Message edited by: Jerry Liu ]
 
Angela Stempfel
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i have exactly the same problem. Has anybody found a solution to this problem?
regards
angela
 
Anand Shivadas
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add the following tab in web.xml for action servlet, I had the sdame problem, now it works fine.
<load-on-startup>0</load-on-startup>
-Anand
 
Fedor Smirnoff
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I spent 2 days, 2days!!! searching for this problem. The thing is that this error can be caused, from what I understand by a lot of things. Anything from mistyped closing tag in .xml file, to simply screweing up on a "/" in the root. However, after 2 days all this was fixed and I was still getting this error. And finally FINALLY, not gonna go into how(long trial and error process), I found whats wrong, so for examples sake lets say your webapplication under Tomcat is called Engine and it resides in Engine directory, I added this to Tomcats main server.xml that is in /conf directory:
<Context path="/Engine" docBase="Engine" debug="0" privileged="true"/>
And than it worked, and I rested of course I tried taking it out and it stopped working so that was it. I have no idea why, any light that you guys can shine on this issue, would be greatly appreciated.
Fedor
 
Mukesh Shetty
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks Anand Shivdas. Your nugget worked!. Could you please elaborate a little if possible as to why is it necessary to add the like in the Action Servlet.
Many Thanks
MS
 
sachin pathak
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main problem lies somewhere else. Please check that you have all the jar files required for struts in your web-inf/lib folder. I got this error solved when I copied the files there. In my VSS we had only those files which we were using and we were getting this error. But it seems that struts internally uses some of its own files. So its better to have ALL files in lib instead of having only the ones you are using.
For version 1.1 there are 6 files in total.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Long due for moving to the Struts forum.
bear
 
Quinn Lau
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this problem also.
I use: JBoss 3.2.2, Struts 1.1
I have no problem for a number of trials, it gets fail after several times.
I have tried all solutions above but useless. The solution is just restart JBoss.
However, I am sorry that I don't know the reason at all.
 
Zafar Azeem
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always remember the rule of thumb that whenever you make modifications to the .xml file, check to see if everything is o.k by opening it in the browser because you might have forgot to close the tags or complete the quotes and so on. Once you are sure this is o.k and still does not work then try suggestions that other people have recommended in this thread because there is no one definite answer for this and it is getting difficult to nail this sucker down.
 
Sunesh Kumar
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Just began the taste of Struts...

Here is My problem
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection.

I Found some thing in my log..
Jul 13, 2006 6:44:32 PM org.apache.commons.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 10 column 10: The end-tag for element type "action" must end with a '>' delimiter.
org.xml.sax.SAXParseException: The end-tag for element type "action" must end with a '>' delimiter.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)


Here is My code

account.jsp
<HTML>
<HEAD>
<TITLE> User Maintenance </TITLE>
</HEAD>

<BODY>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>

<html:form action="/account">
<table>
<tr>
<td> <bean:write name="accountBean" property="warning"> </td>
</tr>
<tr>
<td> Email </td>
<td> <html:text property="email" /> </td>
</tr>
<tr>
<td> Password </td>
<td> <html assword property="password" /> </td>
</tr>
</table>
<html:radio property="operation" value="createAccount" />Create Account
<html:radio property="operation" value="modifyAccount" />Modify Account
<html:radio property="operation" value="deleteAccount" />Delete Account
<br>
<html:submit value="Perform Selected Operation" />
</html:form>
</BODY>
</HTML>

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

<form-beans>
<form-bean name="accountBean" type="com.sunesh.struts.AccountBean" />
</form-beans>

<global-forwards>
<forward name="failure" path="/admin/faliure.jsp" />
</global-forwards>

<action-mappings>

<action path="/account"
type="com.sunesh.struts.AccountAction"
name="accountBean"
parameter="operation"
scope="session">

<forward name="create-success" path="/admin/create-confirm.jsp" />
<forward name="modify-success" path="/admin/modify-confirm.jsp" />
<forward name="delete-success" path="/admin/delete-confirm.jsp" />
</action>

</action-mappings>

</struts-config>

web.xml
<web-app>

<servlet>
<servlet-name>as</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
</servlet>

<servlet-class>
<servlet-name>as</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-class>

</web-app>

AccountBean.java
package com.sunesh.struts;

import org.apache.struts.action.*;

public class AccountBean extends ActionForm
{
private String email = "abc@xyz.com";
private String password = "test";

//Variables for operation and warning messages
private String warning = "";
private String operation = "";

public String getEmail()
{
return this.email;
}

public void setEmail(String email)
{
this.email = email;
}

public String getPassword()
{
return this.password;
}

public void setpassword(String password)
{
this.password = password;
}

public String getWarning()
{
return this.warning;
}

public void setWarning(String warning)
{
this.warning = "<h2><font color=red>"+ warning + "</font></h2>";
}

public String getOperation()
{
return this.operation;
}

public void setOperation(String operation)
{
this.operation = operation;
}
}

Sorry friends for trobling you...but please help because it is eating my brain from past 3 days and I could not solve that...

And one thing more I am using my action class as "DisptachAction"...

please help me , by then I can step a head...

Bye...waiting for ur replies
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the stack trace you've shown us, the problem is clearly the fact that the Struts ActionServlet is unable to parse your struts-config.xml file. I don't see the problem from what you've posted, but here's what I'd recommend:

1-Make a copy of your struts-config.xml file
2-Since it's the <action> tag that the message refers to, remove everything between the <action> and </action> tags.
3-Restart your Application and see if you still get the error message.
4-If you don't get the error message, re-type the <action> tag and try restarting again.
5-If you do get an error message, keep removing items until you no longer get an error message. The last thing you removed is what's causing the problem.
6-Once you've identified the portion of the xml that has the problem, fix it.
 
Sunesh Kumar
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am very much Thankful to you for your response.

I have only one "action" tag in <action-mappings> and i placed like this after ur suggestion.

<action-mappings>
<action>
</action>
</action-mappings>

But still the same error in the Stack is occuring...

and also this...

javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection


What can I do my dear friend...

Bye..
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you'll click on the email icon at the top of this post (the second from the left) you can email me directly. If you'll send your struts-config.xml file as an attachment, I'll see if I can help you find the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic