Eclipse RCP 和 Jython

Eclipse RCP and Jython

我正在编写一个 eclipse RCP 应用程序并希望将 Jython 与其集成。 我已经能够使用控制台视图并选择 PyDev -> Python 控制台来启动 pydev python 控制台。 但是当尝试启动 Jython 时,我遇到了一系列异常:

Jython 可以在我的 Eclipse 中运行,但不能在我的 Eclipse 应用程序中运行。

这是我得到的:

!SESSION 2015-05-07 10:53:51.497 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product AvgPowerTool.product
Command-line arguments:  -product AvgPowerTool.product -data /nfs/iil/proj/dt/sdq06/dmhadar/avg-power-tool/dts_cct_e_explore-avgpowertool/../runtime-AvgPowerTool.product -dev file:/nfs/iil/proj/dt/sdq06/dmhadar/avg-power-tool/dts_cct_e_explore-avgpowertool/.metadata/.plugins/org.eclipse.pde.core/AvgPowerTool.product/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog

!ENTRY org.eclipse.core.resources 2 10035 2015-05-07 10:53:53.939
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.python.pydev.shared_core 4 4 2015-05-07 10:54:19.664
!MESSAGE Unexpected error connecting to console.
!STACK 1
org.eclipse.core.runtime.CoreException: Unexpected error connecting to console.
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:156)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.access[=10=](PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.run(PydevConsoleFactory.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: java.lang.Exception: Failed to recive suitable Hello response from pydevconsole. Last msg received: <type 'org.xml.sax.SAXException'>:org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Command Line used:  "Internal Jython process (no command line)"

Environment:
null
at org.python.pydev.debug.newconsole.PydevConsoleCommunication.hello(PydevConsoleCommunication.java:768)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:145)
... 3 more
!SUBENTRY 1 org.python.pydev.debug 4 4 2015-05-07 10:54:19.667
!MESSAGE Unexpected error connecting to console.
!STACK 0
java.lang.Exception: Failed to recive suitable Hello response from pydevconsole. Last msg received: <type 'org.xml.sax.SAXException'>:org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Command Line used:  "Internal Jython process (no command line)"

Environment:
null
    at org.python.pydev.debug.newconsole.PydevConsoleCommunication.hello(PydevConsoleCommunication.java:768)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:145)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.access[=10=](PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.run(PydevConsoleFactory.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY org.python.pydev.debug 4 4 2015-05-07 10:54:19.670
!MESSAGE Error initializing console.
!STACK 1
org.eclipse.core.runtime.CoreException: Unexpected error connecting to console.
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:156)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.access[=10=](PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.run(PydevConsoleFactory.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.Exception: Failed to recive suitable Hello response from pydevconsole. Last msg received: <type 'org.xml.sax.SAXException'>:org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Command Line used:  "Internal Jython process (no command line)"

Environment:
null
    at org.python.pydev.debug.newconsole.PydevConsoleCommunication.hello(PydevConsoleCommunication.java:768)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:145)
    ... 3 more
!SUBENTRY 1 org.python.pydev.debug 4 4 2015-05-07 10:54:19.670
!MESSAGE Unexpected error connecting to console.
!STACK 0
java.lang.Exception: Failed to recive suitable Hello response from pydevconsole. Last msg received: <type 'org.xml.sax.SAXException'>:org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
Command Line used:  "Internal Jython process (no command line)"

Environment:
null
    at org.python.pydev.debug.newconsole.PydevConsoleCommunication.hello(PydevConsoleCommunication.java:768)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.sayHello(PydevConsoleFactory.java:145)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.access[=10=](PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory.run(PydevConsoleFactory.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

在我导入的包中,我有 org.python.pydev.coreorg.python.pydev.debug.newconsole

任何帮助将不胜感激。

看起来你缺少 xerces 库,尝试将它们包含在你的类路径中