我面临着一个奇怪的日食问题。
我有一个带有 CXF、hibernate 和 spring 的多模块 maven 项目。如果我采用 maven 包后产生的战争,并在 tomcat 7 上手动部署它 - 一切正常。但是,如果我尝试使用 eclipse (Servers -> tomcat),我会收到以下错误:
SEVERE: Exception starting filter datasourceFilter
java.lang.ClassNotFoundException: com.X.X.X.X.filter.DataSourceFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:256)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
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)
值得一提的是,我试图与eclipse集成的tomcat是同一个独立的tomcat,我手动部署了war。我使用eclipse Juno ..如果重要的话..
在我的 web.xml 上:
<filter>
<filter-name>datasourceFilter</filter-name>
<filter-class>com.X.X.X.X.filter.DataSourceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>datasourceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
谁能帮我?
伊多布