Search code examples
eclipsetomcatmaveneclipse-wtpm2e

Cannot run maven project in Eclipse with Tomcat 7


I'm trying to run my Maven project in Eclipse with Tomcat 7 by rickt click -> Run as -> Run on Server.

But getting this exception:

05.07.2012 14:38:19 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_22\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\ImageMagick-6.6.5-Q16;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\SlikSvn\bin\;C:\Program Files\ant\bin;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\Java\jdk1.6.0_22;C:\Program Files (x86)\QuickTime\QTSystem\;D:\apache-maven-3.0.4\bin;C:\Program Files (x86)\Android\android-sdk\platform-tools;C:\Program Files (x86)\Android\android-sdk\tools;C:\Users\dt\AppData\Roaming\npm;C:\Program Files (x86)\nodejs\;C:\Program Files\Java\jdk1.6.0_22\bin
05.07.2012 14:38:20 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:template' did not find a matching property.
05.07.2012 14:38:20 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
05.07.2012 14:38:20 org.apache.coyote.ajp.AjpProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
05.07.2012 14:38:20 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1171 ms
05.07.2012 14:38:20 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
05.07.2012 14:38:20 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.4
05.07.2012 14:38:23 org.apache.catalina.startup.ContextConfig checkHandlesTypes
WARNING: Unable to load class [groovy.jmx.builder.package-info] to check against the @HandlesTypes annotation of one or more ServletContentInitializers. 
java.lang.ClassFormatError: Illegal class name "groovy/jmx/builder/package-info" in class file groovy/jmx/builder/package-info
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2804)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1144)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1639)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
    at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1952)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1915)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1802)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1761)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1747)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1252)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:315)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4700)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:773)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:278)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:429)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:662)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:592)
    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:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
java.lang.reflect.InvocationTargetException
    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:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
    at java.lang.Throwable.getStackTraceElement(Native Method)
    at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:481)
    at java.lang.Throwable.printStackTrace(Throwable.java:468)
    at java.lang.Throwable.printStackTrace(Throwable.java:451)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:421)

The project was built with maven without any errors (war file exists)...

EDIT

groovy-all:1.7.4 is used by gmaven-runtime-1.7:1.3 which is used by wro4j-extensions:1.4.7 which i'm using in my project. java.lang.ClassFormatError: Illegal class name "groovy/jmx/builder/package-info" in class file groovy/jmx/builder/package-info But how do I tell wro4j to use a newer version of gmaven-runtime/groovy-all?

EDIT2

Setting this in my pom.xml:

    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>2.0.0</version>
    </dependency>

seems to resolve this exception, but still getting the following:

java.lang.reflect.InvocationTargetException
    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:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
    at java.lang.Throwable.getStackTraceElement(Native Method)
    at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:481)
    at java.lang.Throwable.printStackTrace(Throwable.java:468)
    at java.lang.Throwable.printStackTrace(Throwable.java:451)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:421)

SOLVED Added -XX:MaxPermSize=512m to VM arguments in Run Configurations. Problem solved!


Solution

  • May be due to the following bug: http://jira.codehaus.org/browse/GROOVY-4673