From: Alan K. <jyt...@xh...> - 2010-04-12 15:55:41
|
Hi all, I've just started to do a code review of modjy, and wanted to make a couple of small tweaks. Before changing anything, I quickly ran the unittests, and got 9 failures, all caused by the same thing. The stack trace is given below. Two odd things are 1. The failure seems to occur whenever an attempt is made to import the $py.class file containing a class definition and a function definition. The failure relates to wrapping the function, even when the function is not involved in the test. I.e. the root cause of the exception is java.lang.NoSuchMethodError: org.python.core.Py.makeClass(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; 2. Looking down the stack trace, I can see that each invocation is synchronized, even though it should not be. You can see this by the presence of [java] at org.python.modules.synchronize$SynchronizedCallable.__call__(synchronize.java:72) In the stack traces. Any idea why this is failing? I don't know what revision introduced the error. Why are the calls being synchronized? I'm running these tests on Windows Server 2003. Regards, Alan. Here is the stack trace of one of the failures: all 9 are the same. do_test: [echo] Running tests against JDK 1.5, Servlet j2ee1.3 [java] ....E.E.E.E.E.E.E.E.E............................. [java] ......................................... [java] .................... [java] Time: 50.188 [java] There were 9 errors: [java] 1) testAppImportCallable(com.xhaus.modjy.ModjyTestAppInvocation)java.lang.NoSuchMethodError: org.python.core.Py.makeClass(Ljava/lang/String;[Lorg/python/core/PyObject;Lorg/python/core/PyCode;Lorg/python/core/PyObject;)Lorg/python/core/PyObject; [java] at mock_framework.web.handlers.wsgi_handlers$py.f$0(lib_python_folder\mock_framework\web\handlers\wsgi_handlers.py:20) [java] at mock_framework.web.handlers.wsgi_handlers$py.call_function(lib_python_folder\mock_framework\web\handlers\wsgi_handlers.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyCode.call(PyCode.java:18) [java] at org.python.core.imp.createFromCode(imp.java:383) [java] at org.python.core.imp.createFromPyClass(imp.java:202) [java] at org.python.core.imp.loadFromSource(imp.java:562) [java] at org.python.core.imp.find_module(imp.java:468) [java] at org.python.core.PyModule.impAttr(PyModule.java:97) [java] at org.python.core.imp.import_next(imp.java:694) [java] at org.python.core.imp.import_logic(imp.java:756) [java] at org.python.core.imp.import_name(imp.java:818) [java] at org.python.core.imp.importName(imp.java:863) [java] at org.python.core.ImportFunction.__call__(__builtin__.java:1212) [java] at org.python.core.PyObject.__call__(PyObject.java:438) [java] at org.python.core.PyObject.__call__(PyObject.java:444) [java] at modjy.modjy_publish$py.load_importable$6(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py:110) [java] at modjy.modjy_publish$py.call_function(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:146) [java] at org.python.core.PyFunction.__call__(PyFunction.java:327) [java] at org.python.core.PyMethod.__call__(PyMethod.java:124) [java] at modjy.modjy_publish$py.get_app_object_importable$5(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py:91) [java] at modjy.modjy_publish$py.call_function(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:146) [java] at org.python.core.PyFunction.__call__(PyFunction.java:327) [java] at org.python.core.PyMethod.__call__(PyMethod.java:124) [java] at modjy.modjy_publish$py.get_app_object$4(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py:68) [java] at modjy.modjy_publish$py.call_function(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy_publish.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:163) [java] at org.python.core.PyFunction.__call__(PyFunction.java:338) [java] at org.python.core.PyFunction.__call__(PyFunction.java:332) [java] at org.python.modules.synchronize$SynchronizedCallable.__call__(synchronize.java:72) [java] at org.python.core.PyObject.__call__(PyObject.java:423) [java] at org.python.core.PyMethod.__call__(PyMethod.java:139) [java] at modjy.modjy$py.dispatch_to_application$9(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy.py:103) [java] at modjy.modjy$py.call_function(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:181) [java] at org.python.core.PyFunction.__call__(PyFunction.java:350) [java] at org.python.core.PyMethod.__call__(PyMethod.java:154) [java] at modjy.modjy$py.service$7(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy.py:80) [java] at modjy.modjy$py.call_function(X:\xhaus\jython\trunk_new\jython\dist\Lib\modjy\modjy.py) [java] at org.python.core.PyTableCode.call(PyTableCode.java:165) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:297) [java] at org.python.core.PyBaseCode.call(PyBaseCode.java:191) [java] at org.python.core.PyFunction.__call__(PyFunction.java:387) [java] at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220) [java] at org.python.core.PyMethod.__call__(PyMethod.java:211) [java] at org.python.core.PyMethod.__call__(PyMethod.java:201) [java] at org.python.core.PyMethod.__call__(PyMethod.java:196) [java] at org.python.core.PyObject._jcallexc(PyObject.java:3499) [java] at org.python.proxies.modjy.modjy$modjy_servlet$3.service(Unknown Source) [java] at com.xhaus.modjy.ModjyJServlet.service(ModjyJServlet.java:139) [java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) [java] at com.mockrunner.servlet.ServletTestModule.callService(ServletTestModule.java:383) [java] at com.mockrunner.servlet.ServletTestModule.doGet(ServletTestModule.java:251) [java] at com.mockrunner.servlet.BasicServletTestCaseAdapter.doGet(BasicServletTestCaseAdapter.java:187) [java] at com.xhaus.modjy.ModjyTestAppInvocation.testAppImportCallable(ModjyTestAppInvocation.java:86) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.xhaus.modjy.ModjyTestBase.main(ModjyTestBase.java:249) |