I'm able to run "mvn jetty:run-war" just fine in my project. However, when I try to use Cargo with Jetty, I get the following error:
:WARN: failed ContextHandler@627d08{/mywebapp,file:/private/tmp/Jetty__mywebapp/webapp/}
:INFO: Extract jar:file:/private/tmp/cargo/conf/cargocpc.war!/ to /tmp/Jetty__cargocpc/webapp
:INFO: Started SelectChannelConnector @
0.0.0.0:8888:WARN: failed Server@171151
Exception in thread "Thread-1" org.codehaus.cargo.container.ContainerException: Failed to start the Jetty container
at org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(JettyExecutorThread.java
:102)
Caused by: 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:585)
at org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run
(JettyExecutorThread.java:68)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of '
org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log
' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of '
org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log
' visible, which is not allowed.))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java
:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.jasper.servlet.JspServlet
.<init>(JspServlet.java:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0
(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:118)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java
:231)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:37)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:563)
at org.mortbay.jetty.webapp.WebAppContext.startContext
(WebAppContext.java:962)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:341)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:368)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:37)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:133)
at org.mortbay.jetty.Server.doStart(Server.java:246)
at org.mortbay.component.AbstractLifeCycle.start
(AbstractLifeCycle.java:37)
... 5 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of '
org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log
' visible, which is not allowed.)
Here's my profile that enables Cargo + Jetty:
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>${cargo.wait}</wait>
<container>
<containerId>jetty6x</containerId>
<type>embedded</type>
</container>
<configuration>
<properties>
<cargo.hostname>${cargo.host}</cargo.hostname>
<cargo.servlet.port>${cargo.port}</cargo.servlet.port>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Any ideas?
Thanks,
Matt
--
http://raibledesigns.com