You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jorg Heymans <jh...@domek.be> on 2006/01/11 15:20:20 UTC
[M10N] JCL and webapp classloader issues
I am trying to get the webapp to work again now that the jetty folks
kindly produced new snapshots for us. Good news is they are keen to
support us getting our core running :
> Jan Bartel wrote:
>
> ... Snapshot is on it's way to the repository now. A beta release
> will also follow shortly. Let us know if there is anything else we
> can do to help Cocoon on it's way.
Now about the webapp:
---------------------
IMPORTANT : "mvn war:inplace" never removes dependencies in WEB-INF/lib.
So if you remove/upgrade a lib and you'ld like to test the webapp then
you should remove WEB-INF/lib before war:inplace to start from a clean
state.
Trying mvn jetty6:run in cocoon-webapp i get :
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@c7c7bc for
org.apache.commons.logging.impl.Log4JLogger
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
at net.sf.ehcache.CacheManager.<clinit>(CacheManager.java:86)
... 44 more
Caused by: org.apache.commons.logging.LogConfigurationException: No
suitable Log constructor [Ljava.lang.Class;@c7c7bc for
org.apache.commons.logging.impl.Log4JLogger
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:432)
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
... 47 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
at java.lang.Class.getConstructor0(Class.java:1930)
at java.lang.Class.getConstructor(Class.java:1027)
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:429)
... which is a classloader issue AFAICT.
Reading Ceki Gülcü's trashing of commons-logging [1], i'm wondering if
we have other options as to what our usage of JCL is concerned (slf4j
[2] ?).
I'm by no means an expert on classloaders and logging , but Ceki's
wording at the end is clear enough for everyone to understand :
> As demonstrated above, JCL's discovery mechanism invents new and
> original ways of shooting yourself in the foot. For example, with JCL
> you can shoot yourself in the foot while aiming at the sky. Thanks to
> JCL you can be hit by lightning in the middle of the desert when it's
> not raining. If your computing life is too dull and trouble is what
> you are looking for, then JCL is the way to go.
Thoughts? (has this been hashed over before?)
Jorg
[1] http://www.qos.ch/logging/classloader.jsp
[2] http://www.slf4j.org/
jetty6:run is working now (was Re: [M10N] JCL and webapp classloader
issues)
Posted by Jorg Heymans <jh...@domek.be>.
Jorg Heymans wrote:
>
> Caused by: org.apache.commons.logging.LogConfigurationException:
> org.apache.commons.logging.LogConfigurationException: No suitable Log
> constructor [Ljava.lang.Class;@c7c7bc for
> org.apache.commons.logging.impl.Log4JLogger
> at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
> at net.sf.ehcache.CacheManager.<clinit>(CacheManager.java:86)
> ... 44 more
> Caused by: org.apache.commons.logging.LogConfigurationException: No
> suitable Log constructor [Ljava.lang.Class;@c7c7bc for
> org.apache.commons.logging.impl.Log4JLogger
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:432)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
> ... 47 more
> Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
> at java.lang.Class.getConstructor0(Class.java:1930)
> at java.lang.Class.getConstructor(Class.java:1027)
> at
> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:429)
>
>
> ... which is a classloader issue AFAICT.
>
It turned out to be a jetty-solvable issue. They have updated their
snapshots again for us, the jetty6 plugin now runs our 2.2 core!
Read [1], section "How to use the webapp" for instructions on how to get
it running (improvements on the documentation always welcome)
Regards
Jorg
[1] http://cocoon.zones.apache.org/daisy/documentation/g2/756.html
Re: [M10N] JCL and webapp classloader issues
Posted by Mats Norén <ma...@alma.nu>.
Torsten Curdt wrote:
>> Reading Ceki Gülcü's trashing of commons-logging [1], i'm wondering if
>> we have other options as to what our usage of JCL is concerned (slf4j
>> [2] ?).
>>
>> I'm by no means an expert on classloaders and logging , but Ceki's
>> wording at the end is clear enough for everyone to understand :
>>
>>> As demonstrated above, JCL's discovery mechanism invents new and
>>> original ways of shooting yourself in the foot. For example, with JCL
>>> you can shoot yourself in the foot while aiming at the sky. Thanks to
>>> JCL you can be hit by lightning in the middle of the desert when it's
>>> not raining. If your computing life is too dull and trouble is what
>>> you are looking for, then JCL is the way to go.
>>
>>
>>
>> Thoughts? (has this been hashed over before?)
>
sl4j offers a compability/migration layer for JCL so there's really no
reason not to try it... :)
[http://www.slf4j.org/manual.html#gradual]
/Mats
Re: [M10N] JCL and webapp classloader issues
Posted by Torsten Curdt <tc...@apache.org>.
> Reading Ceki Gülcü's trashing of commons-logging [1], i'm wondering if
> we have other options as to what our usage of JCL is concerned (slf4j
> [2] ?).
>
> I'm by no means an expert on classloaders and logging , but Ceki's
> wording at the end is clear enough for everyone to understand :
>
>> As demonstrated above, JCL's discovery mechanism invents new and
>> original ways of shooting yourself in the foot. For example, with JCL
>> you can shoot yourself in the foot while aiming at the sky. Thanks to
>> JCL you can be hit by lightning in the middle of the desert when it's
>> not raining. If your computing life is too dull and trouble is what
>> you are looking for, then JCL is the way to go.
>
>
> Thoughts? (has this been hashed over before?)
Without getting into any holy logging wars here I would suggest maybe
nudging over at jakarta commons a bit. AFAIK quite a few of the JCL
issues are resolved in trunk ...but there has not been a new release
yet. Maybe you give the trunk build a try?
cheers
--
Torsten