|
RE: java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase: msg#00077lang.jython.user
most common problem is jython.jar is not on your classpath; it also makes life easier to compile all the *.py modules in the jython lib directory into a separate jar which can be used to support imports from those libs when not running as jython. -----Original Message----- From: jython-users-admin@xxxxxxxxxxxxxxxxxxxxx [mailto:jython-users-admin@xxxxxxxxxxxxxxxxxxxxx]On Behalf Of Phil Sent: Thursday, March 30, 2006 2:57 PM To: jython-users@xxxxxxxxxxxxxxxxxxxxx Subject: [Jython-users] java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase Importance: Low 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 _______________________________________________ Jython-users mailing list Jython-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/jython-users --------------------------------------------------------------------------- The information contained in this message may be privileged and / or confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and deleting the material from any computer. --------------------------------------------------------------------------- ------------------------------------------------------- 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&kid0944&bid$1720&dat1642
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase, Phil |
|---|---|
| Next by Date: | Re: java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase, Phil |
| Previous by Thread: | Fwd: java.lang.NoClassDefFoundError: org/python/parser/ast/VisitorBase, Walter Chang |
| Next by Thread: | Can't seem to post to mailing lists, Walter Chang |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |