From: Sells, F. <fr...@ad...> - 2001-08-03 14:52:06
|
I have a fairly large application that runs fine under jython. When I try to run it as a jar file, doing >jythonc --core --deep --jar xxx.jar Main.py >java -jar xxx.jar I get a null pointer exception and the python style traceback is always line 0 I'm using jython20, jdk1.3 and JBuilder 4's JDBC classes. Is there any way to get better info other than disabling sections of code until I isolate the offending section. tia Fred |
From: John M. <joh...@ya...> - 2001-08-03 18:28:47
|
The traceback is always line 0. Yes, that's normal unfortunately. Build problem? Here are the rules that I follow: Build jar files using jythonc: (+) Set CLASSPATH for running even when just compiling. (+) Add jython.jar to CLASSPATH while compiling! export CLASSPATH=$CLASSPATH:/home/mudd/jython-2.1a1/jython.jar (+) rm *class; rm <target>.jar; rm -rf jpywork; touch *py (+) jythonc -all --package com.proj.test --jar testRepo.jar $(JYTHONSRCS) <------ With --all, no jython jar needed to run. (+) Run again if get "too many files" error. --- "Sells, Fred" <fr...@ad...> wrote: > I have a fairly large application that runs fine under jython. > > When I try to run it as a jar file, doing > > >jythonc --core --deep --jar xxx.jar Main.py > > >java -jar xxx.jar > > I get a null pointer exception and the python style traceback is > always line > 0 > > I'm using jython20, jdk1.3 and JBuilder 4's JDBC classes. Is there > any way > to get better info other than disabling sections of code until I > isolate the > offending section. > > tia > > Fred > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ |
From: Fred S. <fr...@su...> - 2001-08-03 20:05:46
|
I'll give the hints below a try, meanwhile I've isolated the problem better. I have a jar file that I developed in java1.3 using JBuilder and the compiler provided with it (I assume jdk 1.3). When I import that file while running jython, all is well HOWEVER when I jythonc my main (using --all --jar Main.py) and run it -- I can import the package but it does not have any visible contents. i.e. import ezjava print dir(ezjava) ["__name__"] is all I get the classes in ezjava are all public; I'm stumped. John Mudd wrote: > The traceback is always line 0. Yes, that's normal unfortunately. > > Build problem? Here are the rules that I follow: > > Build jar files using jythonc: > (+) Set CLASSPATH for running even when just compiling. > (+) Add jython.jar to CLASSPATH while compiling! > export CLASSPATH=$CLASSPATH:/home/mudd/jython-2.1a1/jython.jar > (+) rm *class; rm <target>.jar; rm -rf jpywork; touch *py > (+) jythonc -all --package com.proj.test --jar testRepo.jar > $(JYTHONSRCS) <------ With --all, no jython jar needed to run. > (+) Run again if get "too many files" error. > > --- "Sells, Fred" <fr...@ad...> wrote: > > I have a fairly large application that runs fine under jython. > > > > When I try to run it as a jar file, doing > > > > >jythonc --core --deep --jar xxx.jar Main.py > > > > >java -jar xxx.jar > > > > I get a null pointer exception and the python style traceback is > > always line > > 0 > > > > I'm using jython20, jdk1.3 and JBuilder 4's JDBC classes. Is there > > any way > > to get better info other than disabling sections of code until I > > isolate the > > offending section. > > > > tia > > > > Fred > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > http://lists.sourceforge.net/lists/listinfo/jython-users > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ |
From: <bc...@wo...> - 2001-08-06 19:46:11
|
[Fred Sells] >I have a jar file that I developed in java1.3 using JBuilder and the >compiler provided with it (I assume jdk 1.3). When I import that file while >running jython, all is well HOWEVER when I jythonc my main (using --all >--jar Main.py) and run it -- I can import the package but it does not have >any visible contents. > >i.e. > >import ezjava >print dir(ezjava) > >["__name__"] is all I get > >the classes in ezjava are all public; I'm stumped. You would get the same result if you use tried it on any other java package. It isn't a problem with your ezjava.jar file. If you want to use dynamic reflection in a staticly compiled program you can try adding code like this somewhere in your Main.py file: if 1 == 0: from ezjava import * It doesn't have to executed as long as the compiler can see the code. Also look for the text Required packages: ezjava* in the jythonc output. regards, finn |