DPascalBernard / maven-alfresco-archetypes

Automatically exported from code.google.com/p/maven-alfresco-archetypes
0 stars 0 forks source link

commons-logging / slf4j / commons discovery - Non fatal Classloading issue when Axis (in the alfresco.war) starts up in Tomcat7 maven plugin #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

For the AMP archetype:
1.mvn clean install -Pamp-to-war,run 
2.At the end end of the Alfresco (successful) startup, the following exception 
is thrown when loading the Axis servlet:

SEVERE: Servlet /alfresco threw load() exception
org.apache.commons.discovery.DiscoveryException: Class 
org.apache.commons.logging.impl.SLF4JLogFactory does not implement 
org.apache.commons.logging.LogFactory
    at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180)
    at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201)
    at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:195)
    at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
    at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
    at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
    at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
    at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
    at org.apache.axis.transport.http.AxisServletBase.<clinit>(AxisServletBase.java:58)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:138)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

3. Alfresco works, but (most likely, not tested) Axis won't.

What is the expected output? What do you see instead?
No exceptions, Axis working.

More investigation:
We clearly have a classloading issue. I tried to remove some of the 
commons-logging stuff following some posts on not having two commons-logging 
versions on the classpath, but unsuccessfully. Maybe could also be related to 
slf4j itself 
(https://confluence.atlassian.com/pages/viewpage.action?pageId=227414216), not 
entirely sure at this time.

Original issue reported on code.google.com by colum...@gmail.com on 30 Oct 2013 at 6:29

GoogleCodeExporter commented 9 years ago

Original comment by colum...@gmail.com on 5 Nov 2013 at 4:45

GoogleCodeExporter commented 9 years ago
i managed to get rid of the exception by adding the bridge between commons 
logging and slf4j as dependency in the pom of my amp project:
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jcl-over-slf4j</artifactId>
    <version>1.5.11</version>
</dependency>

@see http://www.slf4j.org/legacy.html#jclOverSLF4J

Original comment by haas...@gmail.com on 14 Nov 2013 at 12:06

GoogleCodeExporter commented 9 years ago
This worked for me as well, thanks!

Original comment by bulat.ya...@gmail.com on 17 Nov 2013 at 1:45

GoogleCodeExporter commented 9 years ago
You guys Rock!

I will look to make sure this is added both to the -Pamp-to-war profile (for 
the AMP) and to the -Prun profile (for the all-in-one)

Original comment by colum...@gmail.com on 17 Nov 2013 at 1:51

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r732.

Original comment by colum...@gmail.com on 17 Nov 2013 at 2:53