The change suggested in http://jira.codehaus.org/browse/JANINO-159 seems reasonable. Could you try it and see if it fixes the issue?


On 04.06.2013 13:16, diroussel wrote:
Hi,

I've inherited an existing application. One of the first things I did was to
move it from java.util.logging to logback using the excellent SLF4J
migration tool.   It works fine with an console appender, but when I try to
use Janino in the logback.xml I run into trouble.

When I add this to the logback.xml:

<if condition='!property("myapp.log.dir").isEmpty()'>
...
</if>

Then I get "Failed to parse condition
[!property("callisto.log.dir").isEmpty()]
org.codehaus.janino.JaninoRuntimeException: Trying to add an auxiliary class
"ch.qos.logback.core.joran.conditional.PropertyWrapperForScripts" while
another class with the same name is already loaded".

I've used this approach before, so I suspect it's something to do with GWT
and the intellij GWT pluging doing something funny with the class loader.

Has anyone seen this before, or got an idea where to start looking for a
solution?

There is a potention suggested fix here:
http://jira.codehaus.org/browse/JANINO-159
But it requires a change in logback... if it's related.

Thanks

David

P.S.  Full stack trace below



11:59:24,293 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction -
Failed to parse condition [!property("callisto.log.dir").isEmpty()]
org.codehaus.janino.JaninoRuntimeException: Trying to add an auxiliary class
"ch.qos.logback.core.joran.conditional.PropertyWrapperForScripts" while
another class with the same name is already loaded
        at org.codehaus.janino.JaninoRuntimeException: Trying to add an 
auxiliary
class "ch.qos.logback.core.joran.conditional.PropertyWrapperForScripts"
while another class with the same name is already loaded
        at      at
org.codehaus.janino.SimpleCompiler$AuxiliaryClassLoader.addAuxiliaryClass(SimpleCompiler.java:266)
        at      at
org.codehaus.janino.SimpleCompiler$AuxiliaryClassLoader.access$200(SimpleCompiler.java:245)
        at      at
org.codehaus.janino.SimpleCompiler.classToType(SimpleCompiler.java:346)
        at      at
org.codehaus.janino.ClassBodyEvaluator.addPackageMemberClassDeclaration(ClassBodyEvaluator.java:286)
        at      at
org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:212)
        at      at 
org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:194)
        at      at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
        at      at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:72)
        at      at
ch.qos.logback.core.joran.conditional.PropertyEvalScriptBuilder.build(PropertyEvalScriptBuilder.java:50)
        at      at
ch.qos.logback.core.joran.conditional.IfAction.begin(IfAction.java:67)
        at      at
ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:275)
        at      at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:147)
        at      at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:129)
        at      at 
ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
        at      at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at
ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
        at      at
ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
        at      at 
org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
        at      at
org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at      at
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
        at      at 
org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at      at
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
        at      at
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
        at      at 
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at      at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:270)
        at      at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at      at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
        at      at 
org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
        at      at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
        at      at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
        at      at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
        at      at
com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468)
        at      at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at      at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at      at
org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
        at      at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at      at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at      at org.mortbay.jetty.Server.doStart(Server.java:222)
        at      at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
        at      at
com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672)
        at      at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
        at      at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
        at      at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
        at      at com.google.gwt.dev.DevMode.main(DevMode.java:311)
        at      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at      at java.lang.reflect.Method.invoke(Method.java:597)
        at      at 
com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



--
View this message in context: 
http://logback.10977.n7.nabble.com/JaninoRuntimeException-Trying-to-add-an-auxiliary-class-tp12422.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
Logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user



--
Ceki
65% of statistics are made up on the spot
_______________________________________________
Logback-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-user

Reply via email to