Hi Ron,

I don't understand the problem. What is "t5" here?

Cheers,
Marc.
-- 
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com

Ron C Carman wrote:
> I'm having a problem that involves instantiating a Log4J Logger using 
> Groovy within a webtest.
> 
> This works fine:
> 
>       <groovy description="groovy test 4">
>         import org.apache.log4j.Logger;
>         l = Logger.getLogger(Logger.class);
>         println("Groovy test 4 completed!");
>       </groovy>
> 
> But this fails, even though the "t5" class it intantiates calls the same 
> "getLogger" method:
> 
>       <groovy description="groovy test 5">
>         test = new t5();
>         println("Groovy test 5 completed!");
>       </groovy>
> 
> Both test4 and test5 when run through Groovy alone work fine, so this 
> appears to be a problem with Webtest.
> 
> Anyone seen this behaviour? Better, anyone know how to fix it?
> 
> Thanks!
> 
> Caused by: ...\javaHack.xml:38: java.lang.NoClassDefFoundError: 
> Lorg/apache/log4j/Logger;
>                  at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
>                  at org.apache.tools.ant.Task.perform(Task.java:348)
>                  at 
> com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
>                  at 
> com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:31)
>                  at com.canoo.webtest.steps.Step.execute(Step.java:101)
>                  ... 35 more
> Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Logger;
>                  at java.lang.Class.getDeclaredFields0(Native Method)
>                  at java.lang.Class.privateGetDeclaredFields(Unknown 
> Source)
>                  at java.lang.Class.getDeclaredFields(Unknown Source)
>                  at 
> org.codehaus.groovy.reflection.CachedClass$2.run(CachedClass.java:217)
>                  at java.security.AccessController.doPrivileged(Native 
> Method)
>                  at 
> org.codehaus.groovy.reflection.CachedClass.getFields(CachedClass.java:214)
>                  at 
> groovy.lang.MetaClassImpl.addFields(MetaClassImpl.java:1719)
>                  at 
> groovy.lang.MetaClassImpl.inheritFields(MetaClassImpl.java:1714)
>                  at 
> groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:1603)
>                  at 
> groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2508)
>                  at 
> groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2479)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getGlobalMetaClass(MetaClassRegistryImpl.java:253)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.access$100(MetaClassRegistryImpl.java:45)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getFromGlobal(MetaClassRegistryImpl.java:112)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getMetaClass(MetaClassRegistryImpl.java:88)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$MyThreadLocal.getMetaClass(MetaClassRegistryImpl.java:361)
>                  at 
> org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:265)
>                  at 
> org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:808)
>                  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNewN(ScriptBytecodeAdapter.java:230)
>                  at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNew0(ScriptBytecodeAdapter.java:237)
>                  at Script1.run(Script1.groovy:2)
>                  at groovy.lang.GroovyShell.evaluate(GroovyShell.java:543)
>                  at groovy.lang.GroovyShell.evaluate(GroovyShell.java:518)
>                  at 
> com.canoo.webtest.extension.groovy.GroovyInvoker.doExecute(GroovyInvoker.java:40)
>                  at 
> com.canoo.webtest.extension.groovy.GroovyStep.doExecute(GroovyStep.java:37)
>                  at com.canoo.webtest.steps.Step.execute(Step.java:101)
>                  at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>                  at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown 
> Source)
>                  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>                  at java.lang.reflect.Method.invoke(Unknown Source)
>                  at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
>                  ... 39 more
> 
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
> 


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to