When you see a SyntaxError: Lexical error  in your Jython as reported by wsadmin, it can often mean that you have forgotten to delimit a string concatenation

C:\scripts>"C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.bat" -lang jython -f "C:/scripts/gen.py" "c:/scripts/gen.props"
WASX7209I: Connected to process "server1" on node myNode01 using SOAP connector;  The type of process is: UnManagedProcess
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[c:/scripts/gen.props]"
WASX7017E: Exception received while running file "C:/scripts/gen.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
File "<string>", line 206
x += indent + "#endDef
SyntaxError: Lexical error at line 206, column 25.  Encountered: "\r" (13), after : ""


You can see that the the coed below has a ” missing.

x += indent + "#endDef


x += indent + "#endDef"


Leave a Reply