Message3025

Author ks_srikanth
Recipients
Date 2006-12-09.04:03:40
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi,
I have created .py script and trying to execute the script from my application deployed in Weblogic9.1. I am using Jython2.2 for the same. Though I have set the application jar file in the CLASSPATH, Jython finds only the package.
My script code is as simple as this: 
-----------------------------------
from com.xyz.components.impl import Class1
c1 = Class1()
c1.execute()
-----------------------------------
In the above example, Jython throws an ImportError for Class1 at line1, though it recognizes the package. 
I got some hints when I did some internet search - using PySystemState.addPackage("com.xyz.components.impl.Class1")
Now, the import error has vanished. But it throws a "NullPointerException" at line 2. 
------------------------------
The error is ...
java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native method)
    at org.python.core.PyJavaClass.check_lazy_allowed(PyJavaClass.java:92)
    at org.python.core.PyJavaClass.initLazy(PyJavaClass.java:99)
    at org.python.core.PyJavaClass.initialize(PyJavaClass.java:116)
....
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:169)
-------------------------------
Assuming this a class loader problem, I even tried to extend PythonInterpreter and set myClassLoader to PySystemState during initializing. But still it has not resolved my problem. 
Am I going in the right direction? Is there any easy fix for the problem? Can anyone help me find the correct solution for this? 

History
Date User Action Args
2008-02-20 17:19:00adminlinkissue1611977 messages
2008-02-20 17:19:00admincreate