jython and java application

ShoqulKutlu kursat.kutlu at gmail.com
Thu Nov 26 04:20:44 CET 2009


Hi,

I don't know how do you call the java library from within your jython
application it gives java.lang.NoClassDefFoundError
This looks like you referenced jar or whatever else from your jython
application which also needs a class com/bloomberglp/blpapi/Session
in another library file. It might run while running standalone because
the dependent libraries exists where it looks for. For your jython
application you need to make krbtest referenced to the dependent
libraries. It seems you application took a copy of krbtest and other
libraries not available to krbtest there. I hope it helps.

Regards,
Kutlu



On Nov 26, 4:49 am, KB <ke... at nekotaku.com> wrote:
> Hmmm, for some reason my follow up post didn't make it.
>
> Modified jython script to:
>
> # Eclipse package name for java application
> import krbtest
>
> import java.lang as lang
> from java.lang import String
> from jarray import array
>
> myargs=array([],String)
>
> krbtest.SimpleHistoricTutorial().main(myargs)
> ****
>
> Now I get:
>
> Traceback (most recent call last):
>   File "test.py", line 15, in <module>
>     krbtest.SimpleHistoricTutorial().main(myargs)
>         at krbtest.SimpleHistoricTutorial.run(SimpleHistoricTutorial.java:27)
>
>         at krbtest.SimpleHistoricTutorial.main(SimpleHistoricTutorial.java:
> 22)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
>         at java.lang.reflect.Method.invoke(Unknown Source)
>
> java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: com/
> bloomberglp/blpapi/Session
>
> I would post the java app but its quite large, but the main defn:
>
>         public static void main(String[] args) throws Exception
>         {
>                 SimpleHistoricTutorial example = new SimpleHistoricTutorial();
>                 example.run();
>         }
>
> Is pretty vanilla. I have tried making the run() a public method and
> call it, all to no avail.
>
> Note, the Java app works fine standalone, I just need to call it from
> jython.
>
> Again, any help appreciated.




More information about the Python-list mailing list