[groovy-user] InvocationTargetException with JavaWebStart

7 views
Skip to first unread message

verbose

unread,
Apr 16, 2008, 9:39:15 AM4/16/08
to us...@groovy.codehaus.org

I'm using groovy in a JavaWebStart project. But I have the following message
in the JWS console :

java.lang.reflect.InvocationTargetException
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:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1272)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1218)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1065)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ExceptionInInitializerError
at
org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:46)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
at groovy.lang.Binding.<init>(Binding.java:32)
at groovy.lang.GroovyShell.<init>(GroovyShell.java:55)
at swinger.components.ScriptTag.<clinit>(ScriptTag.java:15)

Here is the code for the line 15 :
15:private static GroovyShell shell = new GroovyShell();

So GroovyShell class cannot be instanciated. Can you help me to fix the bug
?
--
View this message in context: http://www.nabble.com/InvocationTargetException-with-JavaWebStart-tp16722255p16722255.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


Jochen Theodorou

unread,
Apr 16, 2008, 12:40:41 PM4/16/08
to us...@groovy.codehaus.org
verbose schrieb:

but it is not this line that is directly causing the problem.... the
stack is

>> org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:46)
>> at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
>> at groovy.lang.Binding.<init>(Binding.java:32)
>> at groovy.lang.GroovyShell.<init>(GroovyShell.java:55)
>> at swinger.components.ScriptTag.<clinit>(ScriptTag.java:15)

meaning, that during execution of the static constructor of ScriptTag a
new GroovyShell will be created... that fits your line. To do so, a new
Binding is created, which calls to GroovyObjectSupport, since Binding is
a subclass of it and in there InvokerHelper is called.. I guess for
setting the MetaClass. but this fails in the static constrcutor of
InvokerHelper...

the exact reason why this fails is lost, I guess it is a nested
exception that is simply not printed here. It could be that it is when
the GroovyRegistry is accessed, but this is pure speculation and does
not mean anything...Since you use web start it is much more possible
that a required permission is not granted, like reading a system
property, or.... well I do not know exactly... did you set any permissions?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

verbose

unread,
Apr 17, 2008, 3:37:59 AM4/17/08
to us...@groovy.codehaus.org

I had modified my code and I think it the reason why I have an error now.
Indeed, I have try without using Java Web Start and I have an error too. I
haven't before changes.

Here is the message in desktop configuration :
Exception in thread "main" java.lang.NoClassDefFoundError:
org/objectweb/asm/Opcodes
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.codehaus.groovy.reflection.CachedClass$1.run(CachedClass.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at
org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:146)
at groovy.lang.MetaClassImpl.addInterfaceMethods(MetaClassImpl.java:291)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:213)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2469)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:185)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:145)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:27)


at
org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:46)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
at groovy.lang.Binding.<init>(Binding.java:32)
at groovy.lang.GroovyShell.<init>(GroovyShell.java:55)
at swinger.components.ScriptTag.<clinit>(ScriptTag.java:15)

[...]

It is strange because I haven't any problem before with Opcode class. So I
have imported the library which contains this class, but I still have the
same message. I'm trying to reverse changes but I don't understand the sens
of the error message given that asm librairy is in the class path.

verbose

unread,
Apr 18, 2008, 5:54:05 AM4/18/08
to us...@groovy.codehaus.org

The error above is new fixed. But I steel have the first error message
concerning the InvocationTargetException although my application runs
perfectly on "desktop" mode.

Here is the jnlp file :

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost/swinger/" href="appli.jnlp">
<information>
<title>Swinger Application</title>
<vendor>Hadrien Fortin</vendor>
</information>

<resources>
<j2se version="1.5+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="http://localhost/swinger/swinger.jar"/>
</resources>

<application-desc main-class="swinger.Swinger">
<argument>http://localhost/swinger</argument>
<argument>test.swg</argument>
</application-desc>
</jnlp>

--
View this message in context: http://www.nabble.com/InvocationTargetException-with-JavaWebStart-tp16722255p16762985.html

Reply all
Reply to author
Forward
0 new messages