Just tried proposed workaround and got exception: 

Error configuring application listener of class 
com.opensymphony.webwork.lifecycle.SessionLifecycleListener
java.lang.ExceptionInInitializerError
        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:525)
        at 
org.apache.webbeans.inject.InjectableConstructor.doInjection(InjectableConstructor.java:89)
        at 
org.apache.openejb.cdi.ConstructorInjectionBean.createInstance(ConstructorInjectionBean.java:77)
        at 
org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:186)
        at org.apache.openejb.core.WebContext.newInstance(WebContext.java:107)
        at 
org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:55)
        at 
org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:48)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
        at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
        at 
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified 
log class 'org.apache.openejb.log.commonslogging.Log4J4AppOpenEJB4ContainerLog' 
cannot be found or is not useable.
        at 
org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:874)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
        at 
com.opensymphony.webwork.lifecycle.SessionLifecycleListener.<clinit>(SessionLifecycleListener.java:28)
        ... 24 more

-----Ursprüngliche Nachricht-----
Von: Romain Manni-Bucau [mailto:[email protected]] 
Gesendet: Mittwoch, 6. Februar 2013 11:21
An: [email protected]
Betreff: Re: AW: Class loading problem in TomEE 1.5.1

that's more or less a bug in commons-logging which respects classloading but 
uses the current class loader configuration even when instantiating classes 
from upper classloader.

It means it works for your app but not for the container part (myfaces) which 
will reuse your config but the parent classloader.

The workaround i added is the following one:

replace
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
by
org.apache.commons.logging.Log=org.apache.openejb.log.commonslogging.
Log4J4AppOpenEJB4ContainerLog

i opened https://issues.apache.org/jira/browse/TOMEE-758 about it

PS: you can implement any other facade you'd like to match your need

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/2/5 <[email protected]>

> just have reproduced not exactly the same issue, but very similar, in 
> my test project:  https://github.com/eiskonzept/tomee
> Just package the app and start tomee-plugin with node1 profile.
>
> Explanation:
> I have two dependencies in my project: commons-logging and log4j. If I 
> package both libraries in my webapp I become:
> "LogConfigurationException: User-specified log class 
> 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is 
> not useable"
> which means that commons-logging can't find Log4JLogger class.
>
> When I put log4j.jar in tomee's lib folder it works just fine. But I 
> can't do this with other libraries in real Project, because we  use 
> some special versions of libraries(quartz for example) which are provided by 
> tomee too.
>
> is there any possibility to use my own versions of libraries which 
> already provided by tomee?
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected] 
> [mailto:[email protected]]
> Gesendet: Montag, 4. Februar 2013 13:12
> An: [email protected]
> Betreff: AW: AW: Class loading problem in TomEE 1.5.1
>
> I got further by copying log4j.jar in CATALINA_BASE/lib folder, but 
> then I got next NoClassDefFoundError.
> Most confusing is that the same application deployed in TomEE Version 
> 1.5.0 works perfectly.
> I believe it is some kind of class loader issue. Are there some 
> significant class loader changes between version 1.5.0 and 1.5.1?
> It looks like that container is loading some classes from container 
> provided commons-logging.jar first, and then can't find some classes 
> in WEB-APP/lib which needed by commons-logging.
>
> -----Ursprüngliche Nachricht-----
> Von: Romain Manni-Bucau [mailto:[email protected]]
> Gesendet: Montag, 4. Februar 2013 12:13
> An: [email protected]
> Betreff: Re: AW: Class loading problem in TomEE 1.5.1
>
> Hard to help since we dont "see" the issue
>
> You probably have some conflict in your app.
>
> Check your deps maybe
> Le 4 févr. 2013 12:11, <[email protected]> a écrit :
>
> > I have tried both: with commons-logging in my war file and without.
> > With same result(exception) in both cases.
> > I have tried to isolate the issue in small sample app, but without 
> > success. Unfortunately I can't provide full application for reproduction.
> > Could you give some hints, how can I help you to reproduce the 
> > problem on your side or solve the issue by myself?
> >
> >
> > > Note: did you put commons-logging in your app too?
> >
> > > can you reproduce it in a sample webapp?
> >
>

Reply via email to