logo       

java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase: msg#00076

lang.jython.user

Subject: java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase

Hi all,

I'm a newbie to the world of Jython, and am already addicted to it. Alas, I've hit one problem which has me stumpted and Google has been no help.

I have developed a GUI using Swing in eclipse and it works fine from eclipse or by executing using the jython <filename> command. However when I use jythonc to create a jar file for distribution, although no problems are reported the resulting jar will not execute (I've tried Mac OS X and Win XP - same result). I used the following command (a different error occurs if I use --core rather than --all).

jythonc --all --jar myjar.jar myjython.py

(On Windows I had to add -C <javac path> - but the result is the same)

Now my original version of my GUI worked no problem as a jar, since that I've implemented a generic extension of the JMenu class that automatically adds actionListeners and Keystrokes from a dictionary of object references and specifc keystrokes and added a few more Swing components. However the fact that it runs in Eclipse leads me to believe that the new constructs I use are good and supported by Jython as it would be in Python. I have also used an almost identical menu subclass in another program I've written no problem.

I've had a look at Jython's internal directory structure and the one thing that has struck me is that the 'ast' directory contains no build.xml file. I believe these are used for building with Ant, but I'm out of my depth as far as my Java knowledge goes (I have a Python background and a basic grounding in Java).

I'm using Jython 2.2a1 and Java 1.5.

I'm at my whits end with this, so any help or pointers would be greatly appreicated - I can forward the code if needs be, but my own analysis suggests the issue is elsewhere.

Many thanks,

Phil.


$ java -jar test.jar
Exception in thread "main" Traceback (innermost last):
File "/Users/philipbeadling/dev/GuiBuilder/jythonGui.py", line 0, in main
java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase
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$100(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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
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$100(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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.python.compiler.ProxyMaker.addClassDictInit(ProxyMaker.java:742)
at org.python.compiler.ProxyMaker.build(ProxyMaker.java:782)
at org.python.core.MakeProxies.makeProxy(MakeProxies.java:76)
at org.python.core.PyClass.init(PyClass.java:128)
at org.python.core.PyClass.<init>(PyClass.java:84)
at org.python.core.Py.makeClass(Py.java:1562)
at org.python.core.Py.makeClass(Py.java:1484)
at jythonGui$_PyInner.main$20(jythonGui.java:495)
at jythonGui$_PyInner.call_function(jythonGui.java:205)
at org.python.core.PyTableCode.call(PyTableCode.java:213)
at org.python.core.PyCode.call(PyCode.java:14)
at org.python.core.imp.createFromCode(imp.java:191)
at org.python.core.Py.runMain(Py.java:856)
at jythonGui.main(jythonGui.java:552)

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise