ok, I reverted the change now.

however, I had to comment out commons-logging dependency in order for the tests to pass. if commons-logging is present in the classpath, the logs are redirected to avalon, otherwise commons-logging initialization is ignored.

if commons-logging is in the classpath and is initialized, I get a very mysterious NPE (see the attached test report)

it seems that there is a null child log category name passed to org.apache.log.Logger.getChildLogger() method. But this should not really happen, as the initial call to get that child logger comes from BeanUtils (org.apache.commons.beanutils.MethodUtils.<clinit>(MethodUtils.java:103)):
private static Log log = LogFactory.getLog(MethodUtils.class);


LogFactoryImpl converts that class argument into a String by using "clazz.getName()" and this should never return null...

So it remains mystery for me, how can there be a NPE...

Could someone else uncomment commons-logging in fortress/bean/project.xml and try to build the jar. Does the test fail the same way?

Neeme

Berin Loritsch wrote:

Neeme Praks wrote:

Hmm, as far as I can see (also written in FortressBean.initializeCommonsLogging() javadocs), latest commons-logging release (1.0.4) contains AvalonLogger (http://jakarta.apache.org/commons/logging/api/org/apache/commons/logging/impl/AvalonLogger.html).


also http://jakarta.apache.org/commons/logging/RELEASE-NOTES.txt contains a reference:


[AvalonLogger] Added AvalonLogger, which wraps the logger used by the
Avalon framework. As with other implementations, this
is compiled only if the appropriate dependencies are
satisfied.



and http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.4.jar


seems to contain it...

Should I revert the change? Or have I misunderstood the issue? :-)


It wasn't in anything I found to download. :(

Testsuite: org.apache.avalon.fortress.tools.FortressBeanTestCase
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0,571 sec

Testcase: test(org.apache.avalon.fortress.tools.FortressBeanTestCase):  Caused 
an ERROR
Could not return a reference to the Component 
(Key='org.apache.avalon.fortress.tools.TestInterface')
org.apache.avalon.framework.service.ServiceException: Could not return a 
reference to the Component 
(Key='org.apache.avalon.fortress.tools.TestInterface')
        at 
org.apache.avalon.fortress.impl.lookup.FortressServiceManager.lookup(FortressServiceManager.java:117)
        at 
org.apache.avalon.fortress.tools.FortressBean.run(FortressBean.java:164)
        at 
org.apache.avalon.fortress.tools.FortressBeanTestCase.setUp(FortressBeanTestCase.java:42)
        at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at 
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:79)
        at 
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:110)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
        at com.werken.werkz.Goal.attain(Goal.java:573)
        at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
        at com.werken.werkz.Goal.attain(Goal.java:573)
        at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
        at 
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:634)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:266)
        at org.apache.maven.cli.App.doMain(App.java:486)
        at org.apache.maven.cli.App.main(App.java:1215)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: org.apache.avalon.framework.CascadingException: Could not load 
component
        at 
org.apache.avalon.fortress.impl.handler.ComponentFactory.newInstance(ComponentFactory.java:195)
        at 
org.apache.avalon.fortress.impl.factory.NoopObjectFactory.newInstance(NoopObjectFactory.java:38)
        at 
org.apache.avalon.fortress.impl.handler.AbstractComponentHandler.newComponent(AbstractComponentHandler.java:246)
        at 
org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler.doPrepare(ThreadSafeComponentHandler.java:40)
        at 
org.apache.avalon.fortress.impl.handler.AbstractComponentHandler.prepareHandler(AbstractComponentHandler.java:147)
        at 
org.apache.avalon.fortress.impl.handler.AbstractComponentHandler.get(AbstractComponentHandler.java:177)
        at 
org.apache.avalon.fortress.impl.handler.LEAwareComponentHandler.get(LEAwareComponentHandler.java:96)
        at 
org.apache.avalon.fortress.impl.lookup.FortressServiceManager.lookup(FortressServiceManager.java:99)
        ... 40 more
Caused by: java.lang.ExceptionInInitializerError
        at 
org.apache.avalon.fortress.impl.handler.ComponentFactory.contextualizeComponent(ComponentFactory.java:321)
        at 
org.apache.avalon.fortress.impl.handler.ComponentFactory.newInstance(ComponentFactory.java:176)
        ... 47 more
Caused by: org.apache.commons.logging.LogConfigurationException: 
java.lang.NullPointerException (Caused by java.lang.NullPointerException)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538)
        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.commons.beanutils.MethodUtils.<clinit>(MethodUtils.java:103)
        ... 49 more
Caused by: java.lang.NullPointerException
        at org.apache.log.Logger.getChildLogger(Logger.java:473)
        at 
org.apache.avalon.framework.logger.LogKitLogger.getChildLogger(LogKitLogger.java:244)
        at 
org.apache.commons.logging.impl.AvalonLogger.getLogger(AvalonLogger.java:82)
        at 
org.apache.commons.logging.impl.AvalonLogger.<init>(AvalonLogger.java:73)
        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:274)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        ... 53 more



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Apache Excalibur Project -- URL: http://excalibur.apache.org/

Reply via email to