From: <bc...@wo...> - 2001-11-26 10:53:25
|
[rohit seth] >I am getting >"java.lang.ExceptionInInitializationError: >java.lang.NullPointerException >at >org.Python.core.PySystemState.<init>(PySystemState.java:158) >at >org.Python.util.PythonInterpreter.<init>(PythonInterpreter.java:67) >at >org.Python.util.PythonInterpreter.<init>(PythonInterpreter.java:45) >at PyFactory.initialize(PyFactory.java 9) >at A.run(A.java 9) > >The classes I am using are as follows(I have included >only the required portion of the code):- [A very good example snipped. This kind of bugs can be hell to track down, but with your example it was very easy. Thanks] >Pl explain the cause of the error. When I am creating >and running only one thread then it works fine. But >with more than one threads, it gives this exception. As you have probably guessed, it is a synchronization bug in jython and we will ofcourse add a fix to jython. Meanwhile you can change the definition of your own PyFactory.initialize() to: public static synchronized void initialize() throws ClassNotFoundException{ pyInterp=new PythonInterpreter(); } as a workaround. regards, finn |