我正在尝试创建休眠侦听器。我是在本文的帮助下创建的侦听器。http://www.developer.am/documentation/struts2/?page=struts-2-hibernate-integration-example 在 web.xml 我配置了监听器..我收到以下错误。我该如何解决这个问题?
SEVERE: Exception sending context initialized event to listener instance of class
com.it.utils.HibernateListener
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.it.utils.HibernateListener.contextInitialized(HibernateListener.java:31)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 11 more
我将分享 web.xml ..
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>WelcomeStruts</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>register.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
com.itac.utils.HibernateListener
</listener-class>
</listener>
I am using following jar files in buildpath
x-wrapper-comp-1.8.0.jar
antlr.jar
antlr-2.7.6rc1.jar
antlr-4.0-complete.jar
apache-mime4j-0.6.jar
asm.jar
asm-attrs.jar
c3p0-0.9.2-pre1.jar
cglib-2.1.3.jar
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-digester.jar
commons-discovery-0.2.jar
commons-fileupload.jar
commons-fileupload-1.2.1.jar
commons-fileupload-1.2.2.jar
commons-httpclient-3.1.jar
commons-io-1.3.2.jar
commons-io-2.0.1.jar
commons-lang-2.3.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
commons-validator.jar
datafile.jar
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
freemarker-2.3.15.jar
freemarker-2.3.19.jar
gson-2.2.2.jar
hibernate.cfg.xml
hibernate3.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
httpmime-4.0.1.jar
iText-2.1.7.jar
jaas.jar
jackson-all-1.9.4.jar
jakarta-oro.jar
jasperreports-3.7.4.jar
javassist-3.11.0.GA.jar
jaxen-1.1-beta-7.jar
jaxrpc.jar
jcommon-1.0.16.jar
jdbc2_0-stdext.jar
jfreechart-1.0.13.jar
jsfcompounds-0.0.2.jar
json-lib-2.1.jar
jstl.jar
jta.jar
log4j-1.2.11.jar
log4j-over-slf4j-1.7.2.jar
mchange-commons-0.2.jar
mysql-connector-java-5.0.8-bin.jar
notifier.jar
ognl-2.7.3.jar
ognl-3.0.5.jar
org.json-0.0.1.jar
poi-3.5-beta5-20090219.jar
saaj.jar
slf4j-simple-1.7.2.jar
standard.jar
struts.xml
struts2-core-2.1.8.1.jar
struts2-core-2.3.7.jar
struts2-dojo-plugin-2.1.8.1.jar
struts2-jasperreports-plugin-2.1.8.1.jar
struts2-json-plugin-2.1.8.1.jar
struts2-portlet-plugin-2.1.8.1.jar
struts2-tiles-plugin-2.1.8.1.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
util-bridges.jar
util-java.jar
util-taglib.jar
vssver2.scc
webservices-api.jar
webservices-extra.jar
webservices-extra-api.jar
webservices-rt.jar
webservices-tools.jar
wsdl4j.jar
xwork-core-2.1.6.jar
xwork-core-2.3.7.jar