Message7511

Author mvera
Recipients mvera
Date 2012-11-07.08:42:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352277735.01.0.565901464431.issue1983@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2012-11-07 08:42:15mverasetmessageid: <1352277735.01.0.565901464431.issue1983@psf.upfronthosting.co.za>
2012-11-07 08:42:15mverasetrecipients: + mvera
2012-11-07 08:42:14mveralinkissue1983 messages
2012-11-07 08:42:14mveracreate