java.lang.NoClassDefFoundError: org/python/core/PyException

594 views
Skip to first unread message

noel....@gmail.com

unread,
Sep 14, 2017, 4:27:06 PM9/14/17
to OpenTripPlanner Users
I have a Grizzly server running locally, and I'm trying to run a python (jhython) script with curl --form "scriptfile=@myscript.py" 0.0.0.0:8080/otp/scripting/run and am confronted with the above error message. What could be causing this?

Xavier Prudent

unread,
Sep 15, 2017, 11:03:52 AM9/15/17
to OpenTripPlanner Users
Just to mention I am meeting the same issue.

Xavier

Laurent Grégoire

unread,
Sep 16, 2017, 4:36:44 AM9/16/17
to OpenTripPlanner Users
Hello,


Le jeudi 14 septembre 2017 22:27:06 UTC+2, noel....@gmail.com a écrit :
I have a Grizzly server running locally, and I'm trying to run a python (jhython) script with curl --form "scriptfile=@myscript.py" 0.0.0.0:8080/otp/scripting/run and am confronted with the above error message. What could be causing this?

Which command-line do you use to start it exactly? Jython jar is not included in the OTP shaded jar by default, so you have to download it and include it in the classpath to run OTP scripting:

$ java -cp otp-x.y.z-shaded.jar:jython-standalone.jar org.opentripplanner.standalone.OTPMain --graphs . --script myscript.py

See also my other answer on the opentripplanner-dev mailing list.

HTH,

--Laurent

noel....@gmail.com

unread,
Sep 16, 2017, 3:30:12 PM9/16/17
to OpenTripPlanner Users
Hello Laurent,

I have the latest Jhython standalone .jar in the working directory (I'm not sure what the class path is, I'm not very familiar with Java).

I launch the server with:

java -Xmx3G -jar otp-1.2.0-shaded.jar --build /path/otp --inMemory --script query_otp.py

Where /path/otp is the working directory containing the Jhython .jar, an osm.pbf and GTFS data.

Laurent Grégoire

unread,
Sep 25, 2017, 6:11:06 AM9/25/17
to OpenTripPlanner Users
Hello,

In your command-line you do not specify jython in the classpath. Please use the "-cp" argument instead of "-jar", as I explained in my previous answer, eventually replacing "jython-standalone.jar" by the actual filename if it differs (it may contain a version number).

HTH,

Wenting Li

unread,
Apr 8, 2019, 2:20:05 PM4/8/19
to OpenTripPlanner Users
Hello,

I have met the same problem. I am wondering how you solved the problem at the end?

Thank you very much!

Wenting

在 2017年9月14日星期四 UTC-4下午4:27:06,noel....@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages