1

我正在尝试通过 rickt click -> Run as -> Run on Server 在 Eclipse 中使用 Tomcat 7 运行我的 Maven 项目。

但得到这个例外:

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)

该项目是用 maven 构建的,没有任何错误(war 文件存在)...

编辑

groovy-all:1.7.4 由 gmaven-runtime-1.7:1.3 使用,它由我在项目中使用的 wro4j-extensions:1.4.7 使用。java.lang.ClassFormatError: Illegal class name "groovy/jmx/builder/package-info" in class file groovy/jmx/builder/package-info但是我如何告诉 wro4j 使用更新版本的 gmaven-runtime/groovy-全部?

编辑2

在我的 pom.xml 中设置:

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

似乎解决了这个异常,但仍然得到以下信息:

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)

已解决 添加-XX:MaxPermSize=512m到运行配置中的 VM 参数。问题解决了!

4

1 回答 1

0

可能是由于以下错误:http: //jira.codehaus.org/browse/GROOVY-4673

于 2012-07-05T12:55:39.077 回答