The moose likes Struts and the fly likes Cannot find ActionMappings or ActionFormBeans collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find ActionMappings or ActionFormBeans collection" Watch "Cannot find ActionMappings or ActionFormBeans collection" New topic

Cannot find ActionMappings or ActionFormBeans collection

swapna arava

Joined: Jun 26, 2008
Posts: 13
Hi I got the following exceptions when i am deploying the application using jboss4.2:

Iam using strts validation frame work for both client and serverside validations.But i am getting this errors.that to it is not supporting taglib directives when i am using those.
But i have copied all jar files web-inf and tab files in lib.
Please help me in this issues, i stucked with this since 3 days..

1.Cannot find ActionMappings or ActionFormBeans collection
2.javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
3.javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml

And my files are:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>


<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr><td> </td>
<tr bgcolor="#36566E">
<td height="68" width="48%">
<div align="left">
<img src ="images/logo.gif" width="200" height="74">
<html:form action="/createProjectAction" >

<table width="45%" border="0">

<td><html:text name="createProjectBean" property="ProjectName" /></td>

<td>Periodicity<!--<bean:message key="app.period" bundle="ApplicationResources"/>-->:</td>
<td><html:radio name="createProjectBean" property="Periodicity" value="Monthly"/>Monthly</td>
<td><html:radio name="createProjectBean" property="Periodicity" value="Quarterly"/>Quarterly</td>
<td><html:radio name="createProjectBean" property="Periodicity" value="Quarterly"/>Quarterly</td>

<td>Description<!--<bean:message key="app.desc" bundle="ApplicationResources" />-->:</td>
<td><html:text name="createProjectBean" property="Description" /></td>
<td><html:button property="submit" value="Submit" /></td>


<!-- Begin Validator Javascript Function -->
<html:javascript formName="projectBean"/>
<!-- End of Validator Javascript Function -->

package actionClasses;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import formBeans.CreateProjectBean;

public class CreateProjectAction extends Action

public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request,
HttpServletResponse response)throws Exception
System.out.println("Entered in Action class");
String name,period,desc;

CreateProjectBean bean=(CreateProjectBean)form;
period = bean.getperiodicity();
name = bean.getprojectName();
desc = bean.getdescription();

return mapping.findForward("failure");


}catch(Exception e)
return mapping.findForward("success");


package formBeans;

import org.apache.struts.validator.ValidatorForm;
public class CreateProjectBean extends ValidatorForm
private static final long serialVersionUID = 1L;
String projectName;
String description;
String periodicity;
public String getprojectName() {
return projectName;
public void setprojectName(String projectName)
this.projectName = projectName;
public String getdescription()
return description;
public void setdescription(String description)
this.description = description;
public String getperiodicity()
return periodicity;
public void setperiodicity(String periodicity)
this.periodicity = periodicity;

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"

This is a blank Struts configuration file with an example
welcome action/page and other commented sample elements.

Tiles and the Struts Validator are configured using the factory defaults
and are ready-to-use.

NOTE: If you have a generator tool to create the corresponding Java classes
for you, you could include the details in the "form-bean" declarations.
Otherwise, you would only define the "form-bean" element itself, with the
corresponding "name" and "type" attributes, as shown here.

<!-- ================================================ Form Bean Definitions
<form-beans type="org.apache.struts.validator.ValidatorForm">
<form-bean name="createProjectBean"
type="formbeans.CreateProjectBean" />
<!-- =========================================== Action Mapping Definitions

<action path="/createProjectAction"
<forward name="success" path="/jsps/success.jsp" />
<forward name="failure" path="/jsps/failure.jsp" />

<!-- Entry for MessageResource.Properties -->

<!-- <message-resources parameter="resouceProperties.ApplicationResources" /> -->

<!-- Validator plugin -->

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->

<!-- Standard Action Servlet Mapping -->

<!-- The Usual Welcome File List -->

<!-- Struts Tag Library Descriptors -->





Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61103

Please be sure to post Struts questions in the Struts forum. I have moved this post there for you.

Also, please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The answer to this question is found in our FAQ. See question 13.

Consultant, Sima Solutions
swapna arava

Joined: Jun 26, 2008
Posts: 13
i thank you
swapna arava

Joined: Jun 26, 2008
Posts: 13
In my strtus application i have applied validator frame work.But the thing is " it is reflecting the form in the sense form is not going to next page uunless i enter all fields data." it is validating the form with out displaying any alert messages like in java script.
satya ganesh

Joined: Jul 14, 2008
Posts: 7
For any body who is reading this page, this might help...

I faced the same problem only for the first time i start the application, it was tricky and i found that in the web.xml, i did not load the ActionServlet during the start-up and it had not parsed the struts-config.xml when the request had come. The problem is solved when i added the following line in web.xml ActionServlet's configuration,
Lynn Hollerman

Joined: Aug 31, 2005
Posts: 4
Also, for anyone reading this, I just ran into this error. I get some applications from other developers and upload them to a server, and this error came up after I had just put an update on - it was a mix of .jsps, .xml files, and .class files. Before I got this error, I got another error I was more familiar with - I have seen this earlier error before, when I was initially trying to figure out Java and saw that it meant that the file I was using was compiled with a later version of the JDK than the server had. The main difference between the production and development servers for me is that production uses JDK 1.5, whereas development uses 1.6.

I initially checked the FAQ here to see if that could help - that said there was either a problem with web.xml or struts-config.xml, but there weren't any code changes to either - just some white space had been removed. But one of the things the FAQ said was that the error could mean that I was trying to execute a .jsp before the Action servlet was initialized, and I *did* see an error message about a problem with load() in one of the logs - but there wasn't any reference to a line in the .xml file as the FAQ said there would be.

It turned out that all the .class files had been compiled with 1.6. First I backed out all the files, and then put the new .jsps and .xml files back in - there was no error. Then, I put the recompiled .class files on and restarted the server. The error was still gone. So, it looks to me as the solution was to recompile the .class files with 1.5 and use those. I thought it was a bit odd that the error message didn't say anything about this, but I don't use Struts in my own programming, so for all I know, this could be well-known error...

I hope this helps someone!

subject: Cannot find ActionMappings or ActionFormBeans collection