Issue1546

classification
Title: Jython crashes with java.lang.NullPointerException in org.python.core.PyType.computeLinearMro() when running a webpy application under Tomcat and modjy
Type: Severity: normal
Components: Core Versions: 2.5.1
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, jlist, pjenvey, zyasoft
Priority: Keywords:

Created on 2010-01-27.18:33:03 by jlist, last changed 2010-10-17.17:04:52 by zyasoft.

Files
File name Uploaded Description Edit Remove
JythonServlet.java amak, 2010-04-10.10:40:33
Messages
msg5460 (view) Author: (jlist) Date: 2010-01-27.18:35:45
I tried to run web.py with modjy and got this exception.
I tried moving jython.jar from the WEB-INF/lib directory
to tomcat lib directory but it didn't help.

java.lang.NullPointerException
       org.python.core.PyType.computeLinearMro(PyType.java:487)
       org.python.core.PyJavaType.init(PyJavaType.java:187)
       org.python.core.PyType.createType(PyType.java:1175)
       org.python.core.PyType.addFromClass(PyType.java:1116)
       org.python.core.PyType.fromClass(PyType.java:1192)
       org.python.core.PyObject.<init>(PyObject.java:67)
       org.python.core.PyMethod.<init>(PyMethod.java:30)
       org.python.core.PyReflectedFunction._doget(PyReflectedFunction.java:46)
       org.python.core.PyObject.__get__(PyObject.java:3672)
       org.python.core.PyObject.object___findattr__(PyObject.java:3716)
       org.python.core.PyObject.object___getattribute__(PyObject.java:3688)
       org.python.core.PyObject$object___getattribute___exposer.__call__(Unknown
Source)
       org.python.core.PyObjectDerived.__findattr_ex__(PyObjectDerived.java:993)
       org.python.core.PyObject.__getattr__(PyObject.java:929)
       modjy.modjy_publish$py.get_app_object$4(C:\java\jython2.5.1\Lib\modjy\modjy_publish.py:63)
       modjy.modjy_publish$py.call_function(C:\java\jython2.5.1\Lib\modjy\modjy_publish.py)
       org.python.core.PyTableCode.call(PyTableCode.java:165)
       org.python.core.PyBaseCode.call(PyBaseCode.java:297)
       org.python.core.PyBaseCode.call(PyBaseCode.java:191)
       org.python.core.PyFunction.__call__(PyFunction.java:385)
       org.python.core.PyFunction.__call__(PyFunction.java:380)
       org.python.modules.SynchronizedCallable.__call__(synchronize.java:53)
       org.python.core.PyObject.__call__(PyObject.java:355)
       org.python.core.PyMethod.__call__(PyMethod.java:215)
       org.python.core.PyMethod.instancemethod___call__(PyMethod.java:221)
       org.python.core.PyMethod.__call__(PyMethod.java:206)
       org.python.core.PyObject.__call__(PyObject.java:414)
       org.python.core.PyObject.__call__(PyObject.java:418)
       modjy.modjy$py.dispatch_to_application$9(C:\java\jython2.5.1\Lib\modjy\modjy.py:103)
       modjy.modjy$py.call_function(C:\java\jython2.5.1\Lib\modjy\modjy.py)
       org.python.core.PyTableCode.call(PyTableCode.java:165)
       org.python.core.PyBaseCode.call(PyBaseCode.java:297)
       org.python.core.PyBaseCode.call(PyBaseCode.java:191)
       org.python.core.PyFunction.__call__(PyFunction.java:385)
       org.python.core.PyMethod.__call__(PyMethod.java:215)
       org.python.core.PyMethod.instancemethod___call__(PyMethod.java:221)
       org.python.core.PyMethod.__call__(PyMethod.java:206)
       org.python.core.PyObject.__call__(PyObject.java:432)
       org.python.core.PyObject.__call__(PyObject.java:436)
       modjy.modjy$py.service$7(C:\java\jython2.5.1\Lib\modjy\modjy.py:80)
       modjy.modjy$py.call_function(C:\java\jython2.5.1\Lib\modjy\modjy.py)
       org.python.core.PyTableCode.call(PyTableCode.java:165)
       org.python.core.PyBaseCode.call(PyBaseCode.java:297)
       org.python.core.PyBaseCode.call(PyBaseCode.java:191)
       org.python.core.PyFunction.__call__(PyFunction.java:385)
       org.python.core.PyMethod.__call__(PyMethod.java:215)
       org.python.core.PyMethod.instancemethod___call__(PyMethod.java:221)
       org.python.core.PyMethod.__call__(PyMethod.java:206)
       org.python.core.PyObject.__call__(PyObject.java:367)
       org.python.core.PyObject._jcallexc(PyObject.java:3500)
       org.python.proxies.modjy.modjy$modjy_servlet$2.service(Unknown Source)
       com.xhaus.modjy.ModjyJServlet.service(ModjyJServlet.java:126)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.18 logs.
msg5628 (view) Author: Philip Jenvey (pjenvey) Date: 2010-04-04.18:25:45
We really need to isolate the problem more, ideally with a reproducible script. Though if this can only be reproduced within modjy, the script case could be more difficult to produce
msg5650 (view) Author: Alan Kennedy (amak) Date: 2010-04-10.10:40:32
We've had a variety of problems running jython under tomcat, and other containers. They are not necessarily modjy specific. The following bug, for example,

Jython crashes in unknown circumstances when running on some servlet containers.
http://bugs.jython.org/issue1489

can be reproduced with a very small piece of code that doesn't use modjy.

Please can I ask you to try running the attached java code, from the above bug, and see if that recreates the problem you're seeing? That should give us a good starting point.

Lastly, what version of jython are you running? Leo made some fixes to the classloading system back in January. 

http://fisheye3.atlassian.com/changelog/jython/?cs=6970

I think that this problem is related to classloading, or related classloading configuration for the container.

It would be good if you try out Leo's fixes by running the latest code. Can you build from trunk and try that to see if it fixes the problem?

Philip, we really need to get a 2.5.2 out the door; there's too many outstanding bug fixes unreleased.
msg5968 (view) Author: Jim Baker (zyasoft) Date: 2010-08-15.16:57:07
Is this still an issue?
msg6153 (view) Author: Alan Kennedy (amak) Date: 2010-10-07.19:55:17
This needs to be tested again to see if the recent classloader changes have fixed it. Preferably before the weekend, so that the issue is closed before the next release.
msg6180 (view) Author: Alan Kennedy (amak) Date: 2010-10-17.14:46:29
I have re-opened and updated the related classloading issue with further details, which indicate that this problem has *not* been fixed.

http://bugs.jython.org/issue1489

Perhaps this issue should be closed as a duplicate of that issue?
msg6183 (view) Author: Jim Baker (zyasoft) Date: 2010-10-17.17:04:51
Alan, seems reasonable, so I'm going to close this as a duplicate for now, based on #1489. OP can reopen if they find it again in webpy, but we have to have something reproducible for us.
History
Date User Action Args
2010-10-17 17:04:52zyasoftsetstatus: open -> closed
resolution: duplicate
messages: + msg6183
2010-10-17 14:46:29amaksetmessages: + msg6180
2010-10-07 19:55:20amaksetmessages: + msg6153
2010-08-15 16:57:07zyasoftsetnosy: + zyasoft
messages: + msg5968
2010-04-10 10:40:34amaksetfiles: + JythonServlet.java
assignee: amak
messages: + msg5650
nosy: + amak
2010-04-04 18:25:46pjenveysetnosy: + pjenvey
messages: + msg5628
2010-01-27 18:35:46jlistsetmessages: + msg5460
2010-01-27 18:33:04jlistcreate