You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Cédric Champeau <ce...@gmail.com> on 2015/04/20 16:31:01 UTC

Re: [groovy-user] groovy.lang.GroovyRuntimeException: Unable to load logging class

Hi!

First of all, please make sure you send your questions to the new mailing
list (I added it in CC), please refer to [1] to see how to subscribe.

Regarding your problem, it seems that you simply don't have slf4j on
classpath (it's an optional dependency).

[1] http://groovy-lang.org/mailing-lists.html

2015-04-20 16:17 GMT+02:00 antoaravinth <an...@gmail.com>:

> I have this code:
>
> @groovy.util.logging.Slf4j
> class TestLog {
>   def bar () {
>     int count=0
>     if( log.isTraceEnabled() )  {
>         log.trace "${count++}"
>     }
>     return count
>   }
>
>   def foo () {
>     int count=0
>     log.trace "${count++}"
>     return count
>   }
>
> }
>
> when I try to run I get:
>
> groovy.lang.GroovyRuntimeException: Unable to load logging class
>         at
>
> org.codehaus.groovy.transform.LogASTTransformation$AbstractLoggingStrategy.classNode(LogASTTransformation.java:270)
>         at
>
> groovy.util.logging.Slf4j$Slf4jLoggingStrategy.addLoggerFieldToClass(Slf4j.java:77)
>         at
>
> org.codehaus.groovy.transform.LogASTTransformation$1.visitClass(LogASTTransformation.java:113)
>         at
>
> org.codehaus.groovy.transform.LogASTTransformation.visit(LogASTTransformation.java:158)
>         at
>
> org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:134)
>         at
>
> org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:178)
>         at
>
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1055)
>         at
>
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
>         at
>
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
>         at
>
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
>         at
> groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:299)
>         at
> groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:269)
>         at groovy.lang.GroovyShell.parseClass(GroovyShell.java:695)
>         at groovy.lang.GroovyShell.run(GroovyShell.java:524)
>         at groovy.lang.GroovyShell.run(GroovyShell.java:504)
>         at groovy.lang.GroovyShell.run(GroovyShell.java:171)
>         at groovy.lang.GroovyShell$run$1.call(Unknown Source)
>         at
>
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
>         at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
>         at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
>         at
> groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy:980)
>         at
> groovy.ui.Console$_runScriptImpl_closure17.doCall(Console.groovy)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:483)
>         at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
>         at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
>         at
>
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
>         at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
>         at groovy.lang.Closure.call(Closure.java:426)
>         at groovy.lang.Closure.call(Closure.java:420)
>         at groovy.lang.Closure.run(Closure.java:507)
>         at java.lang.Thread.run(Thread.java:744)
>
> Where I'm making mistake?
>
>
>
> --
> View this message in context:
> http://groovy.329449.n5.nabble.com/groovy-lang-GroovyRuntimeException-Unable-to-load-logging-class-tp5723390.html
> Sent from the groovy - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>