wood burning stoves 2.0*
The moose likes Struts and the fly likes Unable to initialize Struts ActionServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to initialize Struts ActionServlet" Watch "Unable to initialize Struts ActionServlet" New topic
Author

Unable to initialize Struts ActionServlet

Prasad Suseela
Greenhorn

Joined: Jan 02, 2009
Posts: 5
I am new the JBoss Server. My Dynamic Web application (integrated with struts 1.3) is running fine with Tomcat V5.5. I have deployed my Web Application in JBoss 4.0Successfully. But when I started and try to run the application, It is giving the below Error on Action Servlet.

Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
java.lang.NoSuchMethodError: org.apache.commons.digester.Digester.parse(Ljava/net/URL Ljava/lang/Object;

javax.servlet.UnavailableException: org.apache.commons.digester.Digester.parse(Ljava/net/URL Ljava/lang/Object;
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:402)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)


My Web Application Details :
1)Eclipse 3.4
2) struts 1.3
3) jdk 1.6

I have included all the jar-files under the lib directory

Could you please help me in sorting out this issue???
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Have you setup the all required .jar files in lib directory ? Paste the .jar file from /lib.

This error may occurred If there is mismatch between the struts version used for building and the one used for running the application.

Plus, see for the validness & well formed of web.xml and struts-config.xml against dtd.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Prasad Suseela
Greenhorn

Joined: Jan 02, 2009
Posts: 5
I have included all these jar files under WebContent\WEB-INF\lib directory

antlr-2.7.2.jar
bsf-2.3.0.jar
commons-beanutils-1.7.0.jar
commons-chain-1.1.jar
commons-collections.jar
commons-digester-1.8.jar
commons-fileupload-1.1.1.jar
commons-io-1.1.jar
commons-logging-1.0.4.jar
commons-validator-1.3.1.jar
j2ee.jar
jakarta-oro.jar
jsp-api.jar
jstl-1.0.2.jar
log4j.jar
mysql-connector-java-5.0.0-bet
oro-2.0.8.jar
pg73jdbc2.jar
servlet-api.jar
standard-1.0.2.jar
struts-core-1.3.8.jar
struts-el-1.3.8.jar
struts-extras-1.3.8.jar
struts-faces-1.3.8.jar
struts-mailreader-dao-1.3.8.ja
struts-scripting-1.3.8.jar
struts-taglib-1.3.8.jar
struts-tiles-1.3.8.jar
struts.jar
tools.jar

but still i dont understand what do you mean by "struts version used for running the application"

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
here is my struts-config.xml(for your convenience i have omitted repeated tags...however i maintained the order
in which it appears in my file)

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

<struts-config>

<form-beans>
<!-- Logon form bean -->
<form-bean name="MakeGuessForm" type="sample.MakeGuessForm"></form-bean>
</form-beans>
<global-exceptions/>

<action-mappings>
<!-- Display welcome page -->
<!-- Calendar -->
<action
name="ActionForm"
path="/data"
scope="request"
type="com.example">
<forward
name="success"
path="/rom/rom.jsp"/>
</action>
<global-forwards>
</global-forwards>

<message-resources parameter="ApplicationResources"/>

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

</struts-config>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
My web.xml is


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>My Application</display-name>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>
ApplicationResources
</param-value>
</init-param>

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- session time out -->
<session-config>
<session-timeout>20</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/home/loginpage.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>

</web-app>
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Have you noticed the two different version of struts .jar file you are using for Action class,

Look /lib ther is struts.jar(for Struts 1.x or 1.2.x) and struts-core-1.3.8.jar (for 1.3.x) , So remove this strut.jar and other previous version struts .jar files.

Then rebuild and run.

HTH.
Noopur Julka
Greenhorn

Joined: Jul 07, 2011
Posts: 1

Hello,

I am facing the same error.
I am using Eclipse 3.2.1, Struts 1.3 and JDK 1.5.

The struts.jar is not in my lib. Any other way to debug?

-NoopurJ


Rgds,
Noopur J
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to initialize Struts ActionServlet
 
Similar Threads
can't find digester method
Module 'null' not found in Struts 1.3
Exception while using struts 1.3 with myeclipse 6.0.1
problem deploying my application with weblogic after adding a new form bean
Exception thrown while working with Struts 1.3.8