Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to initialize Struts ActionServlet

 
Prasad Suseela
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prasad Suseela
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic