OpenTripPlanner simple example crashes on Ubuntu 16.04

37 просмотров
Перейти к первому непрочитанному сообщению

Xavier Prudent

не прочитано,
15 сент. 2017 г., 12:57:0215.09.2017
– OpenTripPlanner Developers
Hello,

I want to run OTP on Ubuntu 16.04 LST, 

with the following java version 
    openjdk version "1.8.0_131"

    OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)

    OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

python

    Python 2.7.12

jython

    Jython 2.5.3


and I run OTP 1.2.0 as suggested in the doc:


java -Xmx2G -jar otp-1.2.0-shaded.jar --build otp --inMemory --script script.py


(see enclosed the script and the input data)


and got this error:


Exception in thread "main" java.lang.NoClassDefFoundError: org/python/core/PyException

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:264)

at org.apache.bsf.BSFManager.getLangFromFilename(BSFManager.java:604)

at org.opentripplanner.scripting.impl.BSFOTPScript.<init>(BSFOTPScript.java:43)

at org.opentripplanner.standalone.OTPMain.run(OTPMain.java:149)

at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:86)

Caused by: java.lang.ClassNotFoundException: org.python.core.PyException

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)


Despite much investigation, I still don't have a clue why this simple case crashes. What am I forgetting?


Thanks,

regards,

Xavier



script.py
points.csv

Laurent Grégoire

не прочитано,
16 сент. 2017 г., 04:31:4916.09.2017
– OpenTripPlanner Developers
Salut Xavier,

The Jython jar is not included in the OTP shaded jar during the build (including it by default would make the OTP jar too big, and scripting is not used that much). You have to download Jython and include it in the java command-line as below:

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

For more info you can see this doc: http://docs.opentripplanner.org/en/latest/Scripting/

Latest Jython can be downloaded here (take the standalone jar): http://www.jython.org/downloads.html

HTH,

--Laurent

Le vendredi 15 septembre 2017 18:57:02 UTC+2, Xavier Prudent a écrit :

java -Xmx2G -jar otp-1.2.0-shaded.jar --build otp --inMemory --script script.py

Exception in thread "main" java.lang.NoClassDefFoundError: org/python/core/PyException

Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений