Struts error – NoSuchMethodError : Digester.parse(Ljava/net/URL;)Ljava/lang/Object

Problem

During the Struts initialization, it hits the following error messages.

SEVERE: 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;
	at org.apache.commons.chain.config.ConfigParser.parse(ConfigParser.java:190)
	at org.apache.struts.action.ActionServlet.initChain(ActionServlet.java:1687)

Solution

This is caused by certain method is not found in the commons digester library. You need to upgrade your commons-digester.jar to latest version.

In this case, I’m using “Struts 1.3.10 + commons-digester-1.6.jar + struts-tiles 1.3.10″ combination, and hits the above error message. After upgraded to the latest commons-digester-2.0.jar, the error message is gone.

Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • Nguyen Trung Hieu

    SEVERE: 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.NoClassDefFoundError: org/apache/commons/chain/config/ConfigParser
    at org.apache.struts.action.ActionServlet.initChain(ActionServlet.java:1680)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:350)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1190)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1103)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
    at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
    at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.chain.config.ConfigParser
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    … 14 more

    Anyone can helps me. I get stuck with this one. I follow step by step this example
    http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/

    Although i have added all of neccessary jars.

  • Aman

    yes, after changing to new *.jar… the problem was solved..