logo       

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

lang.jython.user

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

Walter, Fred,

Many thanks for your replies. I've tried adding the jython.jar directory and also my pwd to the CLASSPATH with no luck.

The thing which confuses me is that all other attempts at producing jars from jython have worked for me no problem using 2.2a. Until this issue it has worked OK for me. As far as I can see I haven't done anything different.

My best guess is still that this is a failure to package the required elements into the jar by jythonc to run the app standalone.

Could anyone confirm whether or not the 'ast' package is working with 2.2a and jythonc out of the box?

Thanks,

Phil.

Walter Chang wrote:

Hi Phil,
I believe you still need to make sure that jython.jar is in your
classpath in order for it to work (hence the NoClassDefFoundError)

Also, I thought that jythonc was broken in 2.2a and that we haven't
gotten around to fixing it yet...

I've never used jythonc so just my 2 cents...

Regards,
Walter



On 3/30/06, Phil <phil.beadling@xxxxxxxxxxxxxxxx> wrote:

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




--
Simplicity--the art of maximizing the amount
of work not done--is essential.
from: http://www.agilemanifesto.org/principles.html






-------------------------------------------------------
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