Title: Demo/modjy_webapp is not working when deployed to Weblogic 12c [Syntax error]
Type: crash Severity: major
Components: Core Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, ram4444
Priority: Keywords:

Created on 2016-07-14.01:43:02 by ram4444, last changed 2016-08-27.13:30:02 by amak.

msg10875 (view) Author: ram4444 (ram4444) Date: 2016-07-14.01:44:50
Traceback (innermost last): File "<string>", line 1, in ? File "C:\jython2.7.0\Lib\modjy\", line 30, in ? File "C:\jython2.7.0\Lib\modjy\", line 23, in ? SyntaxError: ('invalid syntax', ('C:\\jython2.7.0\\Lib\\', 194, 58, " caretspace = ((c.isspace() and c or ' ') for c in caretspace)")) :org.python.core.PySyntaxError:null
msg10876 (view) Author: Alan Kennedy (amak) Date: 2016-07-15.16:44:55
This looks like an issue with the traceback module (The error is reported when modjy tries to import the traceback module, on line 23 of

The following line of, which contains a generator comprehension, is choking the parser somehow., line 194
caretspace = ((c.isspace() and c or ' ') for c in caretspace)

The indicated position of the error is character 598, just before the 'for'.
msg10877 (view) Author: Alan Kennedy (amak) Date: 2016-07-15.16:47:51
Until this is resolved, a simple workaround is to comment out the usage of the traceback module in It is only ever used for debugging anyway.

Comment out the "import traceback" statement on line 23

and comment out the for loop that refers to it, on line 73 and 74.

That should get it working again.
msg10878 (view) Author: Alan Kennedy (amak) Date: 2016-07-15.16:50:27
Lastly, I note that you are experiencing this error with jython 2.7.0, which is quite old at this stage: jython is now at version 2.7.1.

Dozens of bugs have been fixed since jython 2.7.0

If you try with the latest jython 2.7.1, the problem will quite likely have been solved.
msg10879 (view) Author: ram4444 (ram4444) Date: 2016-07-16.04:46:00
Thx for reply,

According to my investigation, it is found that the jython version, which weblogic12c includes, is 2.21........much older than 2.7.

After comment that line of codes, further syntax error occurs elsewhere. Further check will be carried on after I have done this on Monday.

Ref link.

Thank you very much.
msg10904 (view) Author: Alan Kennedy (amak) Date: 2016-08-23.10:48:58
Did you get this problem resolved?

Is there some way you can bypass the embedded jython 2.2 interpreter, and make weblogic use jython 2.7 for the web app?
msg10905 (view) Author: ram4444 (ram4444) Date: 2016-08-23.12:38:17
Searching for a few days, I still cannot figure out how to change the default JYTHON_HOME/PYTHON_HOME location. May be it is difficult to do so since the command line interface of Weblogic is written in JYTHON, and the jython core is located in some Library of weblogic.

I have also take a look in the startup script of Weblogic, but still have no solution. 

The best solution I think is let Oracle upgrade their own product library, if it is not able to change the JYTHON_HOME by the user
msg10917 (view) Author: Alan Kennedy (amak) Date: 2016-08-27.13:30:01
These web logic links discuss using a modern version of jython with weblogic.
Date User Action Args
2016-08-27 13:30:02amaksetmessages: + msg10917
2016-08-23 12:38:17ram4444setmessages: + msg10905
2016-08-23 10:48:58amaksetmessages: + msg10904
2016-07-16 04:46:01ram4444setmessages: + msg10879
2016-07-15 16:50:27amaksetmessages: + msg10878
2016-07-15 16:47:51amaksetmessages: + msg10877
2016-07-15 16:44:56amaksetmessages: + msg10876
2016-07-15 16:30:44amaksetassignee: amak
nosy: + amak
2016-07-14 01:46:13ram4444settitle: Demo/modjy_webapp is not working when deployed to Weblogic 12c -> Demo/modjy_webapp is not working when deployed to Weblogic 12c [Syntax error]
2016-07-14 01:45:47ram4444settitle: Demo/modjy_webapp is not working on Weblogic 12c -> Demo/modjy_webapp is not working when deployed to Weblogic 12c
2016-07-14 01:44:50ram4444setmessages: + msg10875
components: + Core, - Any
title: Demo/modjy_webapp -> Demo/modjy_webapp is not working on Weblogic 12c
2016-07-14 01:43:02ram4444create