Created on 2012-11-05.09:19:35 by mvera, last changed 2013-02-19.22:05:29 by fwierzbicki.
|msg7507 (view)||Author: mvera (mvera)||Date: 2012-11-05.09:19:32|
Hi, Jython 2.5.3 Websphere 7.0 fixpack 23 ND 64 bits Windows 2008 64 bits Jython is embedded in a web app. Our application works fine under tomcat/windows 7 32 bits with the Oracle JVM. But when our application is deployed under websphere the scripts we deploy can't be executed. It seems that objectweb asm can't analyse the byte code of classes generated from standard python files. Here is a part of the stacktrace. The complete trace is provided as an attached file. Caused by: java.lang.ArrayIndexOutOfBoundsException at org.python.objectweb.asm.ClassReader.a(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) Any workaround is welcome. Regards, Mickaël
|msg7511 (view)||Author: mvera (mvera)||Date: 2012-11-07.08:42:11|
I solved my problem, but problems exist in Jython. It seems to me that embedding jython in a web application is not really supported. Here is described how I solved my problem. I used the jython-standalone 2.5.3 from maven. This worked well under tomcat but we had to place our scripts at the root of a jar (in a war in an ear), not in a /Lib folder. We also had to separate java classes and .py scripts as we ancountered the mixed folder problem. Then we migrated under websphere 7 and it didn't worked. We had to remove all classes generated from .py scripts in jython-standalone.jar. We moved all .py scrpits in the jython-standalone.jar at the root of the jar. Finaly we had to patch ntpath.py (file attached). We noticed that jython doesn't behave the same in both containers. Here is the sys.path respectively in tomcat and websphere: System Path: [ 'D:\\Home\\Projets\\EcamTool\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\small-web\\WEB-INF\\lib\\Lib', 'D:\\Home\\Projets\\EcamTool\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\small-web\\WEB-INF\\lib\\jython-standalone-2.5.3.jar\\Lib', '__classpath__', '__pyclasspath__/'] [06/11/12 11:15:17:394 CET] 0000005d SystemOut O System Path: ['__classpath__', '__pyclasspath__/'] We also noticed that websphere use precompiled classes and tomcat doesn't. Also, jython causes objectweb to crash under websphere when a class is analyzed. We called the objectweb function in the same environment, it didn't crash. I hope my remarks will help you to improve your software. But unless you improve the web container support, I don't recommend to embed jython in a web application. Last remark, I tried to recompile jython, I abandonned as documentation is obsolete (javacc link broken, links to very old libs), I spent so much time to download informix jdbc I don't understand why and I gave up when I realized I had to install mercurial. Thanks for your work for the open source community. Regards, Mickaël
|msg7519 (view)||Author: Alan Kennedy (amak)||Date: 2012-11-10.15:39:11|
""" Our application works fine under tomcat/windows 7 32 bits with the Oracle JVM. But when our application is deployed under websphere the scripts we deploy can't be executed. It seems that objectweb asm can't analyse the byte code of classes generated from standard python files. """ So, you application works fine a standard web container (Indeed, Tomcat was derived from the original reference implementation by Sun, then donated to the Apache Software foundation). So I'm afraid I can't accept your assertion that "unless you improve the web container support, I don't recommend to embed jython in a web application." Jython works just fine in a wide range of compliant web containers, including, but not limited to - Tomcat - Glassfish - JBoss - Jetty - Caucho Resin - Google Appengine - Amazon Elastic Beanstalk - Etc Your problem lies inside Websphere, which uses complex and poorly documented class-loading mechanisms. Further, these mechanisms are invisible to us, since WebSphere is closed source: it is not possible for us to investigate any issues that arise. This is complicated by the fact that there is already a copy of jython 2.1 embedded in WebSphere, which is used to provide powerful dynamic administration capabilities to WebSphere. http://www.google.com/?q=websphere+jython The existence of two copies of builtin jython classes is a complexity that the IBM WebSphere authors seem to have not factored into their design, or if they have, they have not documented it. Which means that we often get WebSphere users turning up in jython land complaining about jython when in fact it is WebSphere classloading that is at fault. Unfortunately, even though jython is an essential component of WebSphere, IBM provide no support to the jython community, and make no attempt to ensure that their closed source products are compatible our open source product, an open source product from which IBM have benefitted significantly over the lifetime of WebSphere. When IBM do not make any contributions to jython source code: when they provide us with patches that are intended to fix jython on their closed source OSes, IBM give us patches that are out of date http://bugs.jython.org/issue1842 So, although I will make an attempt to figure out how this issue has come about and how to solve it (even though I am only permitted to download a time-limited trial of WebSphere), I would make the following points 1. I would amend your advice to be "unless IBM improve the jython 2.5 support in WebSphere, I don't recommend WebSphere as a container for hosting jython web applications". 2. I would recommend that you switch to using a servlet container that is known and proven to run jython 2.5 successfully, e.g. one of those listed above.
|msg7520 (view)||Author: Alan Kennedy (amak)||Date: 2012-11-10.15:50:28|
What version of ntpath.py did you modify to get the above file? It is significantly different from the ntpath.py currently on the tip. It would be much better if you could provide a patch, which would indicate the changes that you made. Can you provide a patch instead please?
|2013-02-19 22:05:29||fwierzbicki||set||priority: normal|
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.3b2
|2012-11-10 15:50:29||amak||set||messages: + msg7520|
messages: + msg7519
messages: + msg7511
|2012-11-05 10:21:41||mvera||set||files: + jython_stacktrace.txt|
|2012-11-05 10:21:26||mvera||set||files: - jython_stacktrace.txt|