Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 85128 invoked from network); 28 Aug 2008 21:07:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Aug 2008 21:07:15 -0000 Received: (qmail 41548 invoked by uid 500); 28 Aug 2008 21:07:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 41103 invoked by uid 500); 28 Aug 2008 21:07:12 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 41092 invoked by uid 99); 28 Aug 2008 21:07:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2008 14:07:12 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.179.121.31] (HELO viefep11-int.chello.at) (62.179.121.31) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2008 21:06:14 +0000 Received: from [192.168.1.101] (really [84.113.196.60]) by viefep11-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20080828210642.OWYN25286.viefep11-int.chello.at@[192.168.1.101]> for ; Thu, 28 Aug 2008 23:06:42 +0200 Subject: Re: cargo maven2 plugin causing exceptions during build because of commons-logging From: simon To: issues@commons.apache.org In-Reply-To: <48B70F77.3030800@apache.org> References: <19197018.post@talk.nabble.com> <48B70F77.3030800@apache.org> Content-Type: text/plain Date: Thu, 28 Aug 2008 23:06:42 +0200 Message-Id: <1219957602.6268.47.camel@simon-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Yes, hopefully Dennis' suggestion will work. It does look like whatever environment this code is running in, it is using a rather old version of commons-logging. The reported exception only occurs in commons-logging 1.0.x. Version 1.1 of commons-logging was released in May 2006 and 1.1.1 was released in Nov 2007, and neither of these should ever throw an exception (though you might not get any logging in this case, as there is clearly something weird going on with classloader hierarchies). Regards, Simon On Thu, 2008-08-28 at 22:49 +0200, Dennis Lundberg wrote: > The simplest thing to do is to put a commons-logging.properties into the > classpath. The file should contain just one property to set the logging > implementation to something other than log4j, like this: > > org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog > > > Fhomasp wrote: > > Hey, > > > > I've been attempting to load a test environment in a Jetty container for > > JSFUnit through the cargo-maven2-plugin. > > Sadly every time the deployment to Jetty is attempted there is a huge list > > of exceptions caused by Commons-logging. > > When using no logger at all stderr is used for output, causing the following > > exceptionstack, which is roughly the same if I use Log4j: > > > > [INFO] Building war: > > C:\projects\trunk\vlafo\olympus\JSFUnitTest\target\JSFUnitTestWar-1.4.2.war > > [INFO] [cargo:start {execution: start-container}] > > [INFO] No container defined, using a default [jetty6x, embedded] container > > [INFO] [beddedLocalContainer] Jetty 6.x Embedded starting... > > 2008-08-26 15:49:14.375::INFO: Logging to STDERR via > > org.mortbay.log.StdErrLog > > 2008-08-26 15:49:14.421::INFO: jetty-6.1.1rc1 > > 2008-08-26 15:49:14.609::INFO: Extract > > jar:file:/C:/projects/trunk/vlafo/olympus/JSFUnitTest/target > > /JSFUnitTestWar-1.4.2.war!/ to C:\DOCUME~1\DEVELO~ > > 1\LOCALS~1\Temp\Jetty_0_0_0_0_8080_JSFUnitTestWar-1.4.2.war__JSFUnitTestWar-1_4_2__aar4a7\webapp > > 2008-08-26 15:49:19.046::WARN: failed > > org.mortbay.jetty.webapp.WebAppContext@58dfa6{/JSFUnitTestWar > > -1.4.2,jar:file:/C:/projects/trunk/vlafo/olympus/J > > SFUnitTest/target/JSFUnitTestWar-1.4.2.war!/} > > java.lang.ExceptionInInitializerError > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > > Method) > > at > > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: > > 39) > > at > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm > > pl.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.webapp.TagLibConfiguration.configureWebApp(TagLibConfiguration.java:239 > > ) > > at > > org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1188) > > 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 > > org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) > > at > > org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java: > > 120) > > at > > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) > > at > > org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147) > > at > > org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) > > at > > org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117) > > at org.mortbay.jetty.Server.doStart(Server.java:210) > > 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) > > at > > org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(JettyExecutorThread.j > > ava:68) > > Caused by: org.apache.commons.logging.LogConfigurationException: > > org.apache.commons.logging.LogConfi > > gurationException: No suitable Log constructor [Lj > > ava.lang.Class;@12305e8 for org.apache.commons.logging.impl.Log4JLogger > > (Caused by java.lang.NoClass > > DefFoundError: org/apache/log4j/Category) (Caused > > by org.apache.commons.logging.LogConfigurationException: No suitable Log > > constructor [Ljava.lang.Cla > > ss;@12305e8 for org.apache.commons.logging.impl.Lo > > g4JLogger (Caused by java.lang.NoClassDefFoundError: > > org/apache/log4j/Category)) > > 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.myfaces.webapp.StartupServletContextListener.(StartupServletContextListener.java:44) > > ... 24 more > > Caused by: org.apache.commons.logging.LogConfigurationException: No suitable > > Log constructor [Ljava. > > lang.Class;@12305e8 for org.apache.commons.logging > > .impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: > > org/apache/log4j/Category) > > at > > org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413) > > > > at > > org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) > > ... 28 more > > Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category > > at java.lang.Class.getDeclaredConstructors0(Native Method) > > at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) > > at java.lang.Class.getConstructor0(Class.java:2671) > > at java.lang.Class.getConstructor(Class.java:1629) > > at > > org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) > > > > > > After some web searching I found an alternative for log4j or stderr, namely > > slf4j. However using this one still causes a similar exception stack: > > > > [INFO] Generating war > > C:\projects\trunk\vlafo\olympus\JSFUnitTest\target\JSFUnitTestWar-1.4.2.war > > [INFO] Building war: > > C:\projects\trunk\vlafo\olympus\JSFUnitTest\target\JSFUnitTestWar-1.4.2.war > > [INFO] [cargo:start {execution: start-container}] > > [INFO] No container defined, using a default [jetty6x, embedded] container > > [INFO] [beddedLocalContainer] Jetty 6.x Embedded starting... > > 2008-08-25 10:06:07.140::INFO: Logging to STDERR via > > org.mortbay.log.StdErrLog > > 2008-08-25 10:06:07.171::INFO: jetty-6.1.1rc1 > > 2008-08-25 10:06:08.484::INFO: Extract > > jar:file:/C:/projects/trunk/vlafo/olympus/JSFUnitTest/target > > /JSFUnitTestWar-1.4.2.war!/ to C:\DOCUME~1\DEVELO~ > > 1\LOCALS~1\Temp\Jetty_0_0_0_0_8080_JSFUnitTestWar-1.4.2.war__JSFUnitTestWar-1_4_2__aar4a7\webapp > > 2008-08-25 10:06:12.781::WARN: failed > > org.mortbay.jetty.webapp.WebAppContext@10bcb28{/JSFUnitTestWa > > r-1.4.2,jar:file:/C:/projects/trunk/vlafo/olympus/ > > JSFUnitTest/target/JSFUnitTestWar-1.4.2.war!/} > > java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory > > at > > org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) > > at > > org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131) > > at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) > > at > > org.apache.myfaces.webapp.StartupServletContextListener.(StartupServletContextListener.java:44) > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > > Method) > > at > > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: > > 39) > > at > > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm > > pl.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.webapp.TagLibConfiguration.configureWebApp(TagLibConfiguration.java:239 > > ) > > > > I'm at a loss on how to get this issue fixed. If anyone knows what to do, > > by all means let me know ;-) > >