cancel
Showing results for 
Search instead for 
Did you mean: 

Exception thrown: java.lang.NoClassDefFoundError: com/sap/jdsr/writer/DsrIP

Former Member
0 Kudos

Hello,

I am using JCo to connect to a SAP system and the code to connect to the system is in groovy. The same program when executed as ".java" file (instead of ".groovy") works fine and connects to the system. But when used as a ".groovy" file throws this exception at this line: aConnection.connect();

please help.

-Apurv.

Exception thrown: java.lang.NoClassDefFoundError: com/sap/jdsr/writer/DsrIPassport

java.lang.NoClassDefFoundError: com/sap/jdsr/writer/DsrIPassport

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)

at java.lang.Class.getDeclaredMethods(Class.java:1139)

at groovy.lang.MetaClassImpl$12.run(MetaClassImpl.java:1212)

at java.security.AccessController.doPrivileged(Native Method)

at groovy.lang.MetaClassImpl.addMethods(MetaClassImpl.java:1210)

at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:138)

at groovy.lang.MetaClassRegistry.getMetaClassFor(MetaClassRegistry.java:232)

at groovy.lang.MetaClassRegistry.getMetaClass(MetaClassRegistry.java:139)

at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:145)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)

at StandAloneTest.main(Script1:16)

at gjdk.StandAloneTest_GroovyReflector.invoke(Unknown Source)

at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)

at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)

at gjdk.groovy.lang.MetaClassImpl_GroovyReflector.invoke(Unknown Source)

at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)

at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)

at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:146)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)

at StandAloneTest.invokeMethod(Script1)

at org.codehaus.groovy.runtime.InvokerHelper$2.run(InvokerHelper.java:539)

at groovy.lang.GroovyShell.evaluate(GroovyShell.java:485)

at groovy.lang.GroovyShell.evaluate(GroovyShell.java:426)

at gjdk.groovy.lang.GroovyShell_GroovyReflector.invoke(Unknown Source)

at groovy.lang.MetaMethod.invoke(MetaMethod.java:111)

at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)

at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:158)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)

at groovy.ui.Console$_runScript_closure10.doCall(Console.groovy:504)

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:324)

at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67)

at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)

at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:158)

at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)

at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)

at groovy.ui.Console$_runScript_closure10.doCall(Console.groovy)

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:324)

at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67)

at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:363)

at groovy.lang.Closure.call(Closure.java:175)

at groovy.lang.Closure.call(Closure.java:170)

at groovy.lang.Closure.run(Closure.java:251)

at java.lang.Thread.run(Thread.java:534)

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This seems to be a bug of groovy if more than one methods are available (e.g. JCO.Client.execute()).

Groovy takes the wrong method and the JCO do not find the referenced classes.

See oss notes: 662135 and 867169.

Bugfixing: do not use groovy for executing these methods. Build a proxy method in "real" java and call this method within groovy scripts.

Former Member
0 Kudos

jdsr.jar file was missing!