logo       

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

lang.jython.user

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

You're right the parser/ast isn't being packaged, which would explain the problem. It suggest (to me) that Jythonc isn't picking this up correctly.

I've tried specifying this using the '-A' command with jythonc

jythonc -all -A org.python.parser.ast .......

I've also tried org.python.parser.* and org.python.parser.ast.* - although I admit, I'm just hacking around and hoping for the best!

Searching through the generated Java the line the bombs out is in jythonGui.java, built from jythonGui.py:

Py.runMain(jythonGui._PyInner.class, newargs, jythonGui.jpy$packages, jythonGui.jpy$mainProperties, "", new String[] {"string", "random", "traceback", "sre_compile", "atexit", "warnings", "popen2", "getopt", "sre", "sre_constants", "StringIO", "jythonGui", "javaos", "repr", "copy_reg", "re", "linecache", "javapath", "UserDict", "copy", "threading", "stat", "javashell", "sre_parse"});

The odd thing is a very similar application built by jythonc I have produces almost identical code - here Gui.java built from Gui.py:

Py.runMain(Gui._PyInner.class, newargs, Gui.jpy$packages, Gui.jpy$mainProperties, "", new String[] {"string", "random", "traceback", "sre_compile", "atexit", "warnings", "popen2", "getopt", "sre", "sre_constants", "StringIO", "javaos", "repr", "copy_reg", "re", "linecache", "javapath", "UserDict", "copy", "threading", "stat", "Gui", "javashell", "sre_parse"});

This other jar doesn't contain any referances to parser/ast either - in fact both only include referances to org.python.core and org.python.modules. Yet one works and one doesn't.

The only discernable diferance is the order of the String array. 'jythonGui' appears earlier than 'Gui' in the second array - these are then names of my main classes in the respective applications.

Of course the programs arn't identical so this could all be hearsay. But they use the same menu classes I wrote and only differ in the Swing components put onto their respective GUIs.

I guess the way forward (unless anyone has any better solutions), is to manually compile parser/ast from the source included in jython and manually add it to the final package. Does anyone know if this is striaghtforward to do? I'm all ears if anyone has a better suggestions!

Thanks for all the pointers so far,

Phil.

Oti wrote:

What org.python.* packages are inside of myjar.jar ? If parser/ast is
in there, we are not seeing the correct error message.
I believe we had a discussion about this problem already, but I can't
find it at the moment.

sorry, no further ideas,
Oti.


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

Hi Oti,

After creating the jar using:

jythonc --all --jar myjar.jar mygui.py

I run:

java -jar myjar.jar

However if run:

jython mygui.py

It works fine.

The jar method works for several other very similar apps I've written,
I've just gone back and tried these with the same environment settings -
these work fine. With my current app no errors are reported until
execution (as below) and only when built into class files and packaged
into a jar. Any ideas?







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