问题
Getting the following exception in using displaytag-1.2 jar. I have all the necessary library in WEB-INF/lib folder.
javax.servlet.ServletException:java.lang.NoClassDefFoundError:
org/apache commons/lang /UnhandledException
org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for
servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.beans.Introspector.instantiate(Unknown Source)
at java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
at java.beans.Introspector.<init>(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3909)
at or
回答1:
I had the same issue. DisplayTag seems to be incompatible with commons-lang-3x. Using commons lang 2.6 should fix the problem.
回答2:
I don't know which application server you're using, but in Glassfish v2, there's sun-web.xml, where we put delegate=false tag to force only the libs from WEB-INF/libs to be seen by the app.
来源:https://stackoverflow.com/questions/17252947/getting-while-using-displaytag-lib-java-lang-noclassdeffounderror-org-apache-co