ClassNotFound W/ Spring using Eclipse Tomcat Maven M2Eclipse
Sorry I am new to this stack overflow stuff so pardon the long error message at the bottom.
I am trying to deploy a project called BroadLeaf to a Tomcat 7 server using eclipse. I have installed M2Eclipse/WTP Integration. I run a maven configuration (through eclipse) with clean package as the goals. Then I do a refresh and try to start the server, however, it fails.
UPDATE: I am trying to deploy the project found here... https://broadleaf.svn.sourceforge.net/svnroot/broadleaf/trunk/BroadleafCommerce/site/BroadleafCommerceDemo/pom.xml
Any ideas?
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1664) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:406) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:388) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:117) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4268) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:424) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Sep 27, 2011 8:41:12 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.broadleafcommerce.profile.web.extensibility.MergeContextLoaderListener java.lang.ClassNotFoundException: org.broadleafcommerce.profile.web.extensibility.MergeContextLoaderListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1664) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:406) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:388) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:117) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4268) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:424) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Sep 27, 2011 8:41:12 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.springframework.security.web.session.HttpSessionEventPublisher java.lang.ClassNotFoundException: org.springframework.security.web.session.HttpSessionEventPublisher at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1664) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:406) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:388) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:117) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4268) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.cata开发者_C百科lina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:424) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Sep 27, 2011 8:41:12 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Skipped installing application listeners due to previous error(s) Sep 27, 2011 8:41:12 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart Sep 27, 2011 8:41:12 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/broadleaf] startup failed due to previous errors
The problem appears to be with WTP not integrating properly with the maven dependancies. Not the best solution I fixed the issue by....
- in eclipse right click on the project and go to properties
- Go to deployment assembly
- click add
- Select Java Build path entries
- select all the M2_HOME entries.
- Clean build and deploy project DO NOT USE THE M2ECLIPSE PLUGIN WITH ECLIPSE:ECLIPSE!
- Should get you around the error.
Anyone know the real solution?
UPDATE: Also the next time I imported WTP seemed to vibe with Maven, so maybe delete and reimport your project after installing the plugin?
Looking at the pom files in broadleaf source repository, it looks like none of them build a web
application (war
artifact). This is required for the m2eclipse/wtp
integration to work correctly.
If this is not the case, please edit the question specifying the specific broadleaf sub project you are trying to deploy in tomcat.
精彩评论