Cargo Jetty6x Slf4j Logging

1 minute read

I’ve been getting the following error when i trying to start my cargo/jetty6x plugin via maven.

<pre name="code" class="java">
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationExc
eption: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You h
ave 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.LogConfigurationEx
ception: Invalid class loader hierarchy. You have more than one version of ‘org.apache.commons.logg
ing.Log’ visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationExcept
ion: 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.(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:152)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1191)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
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)
</pre>

<pre name="code" class="java">

org.slf4j
jcl-over-slf4j
1.5.3


org.slf4j
slf4j-api
1.5.3


org.slf4j
slf4j-simple
1.5.3

</pre>

I have found this post Switching to SLF4J and this. I believe i have configured my slf4j jars correctly like so

<pre name="code" class="xml">

org.codehaus.cargo
cargo-maven2-plugin

false

jetty6x
embedded



${servlet.port}





start-container
pre-integration-test

start
deploy



stop-container
post-integration-test

stop




</pre>

The standalone jetty plugin seems to run ok.

<pre name="code" class="xml">

org.mortbay.jetty
maven-jetty-plugin
6.1.6



${servlet.port}
30000


/
stop
9091


</pre>

Tags:

Updated:

Leave a Comment