Search code examples
eclipsepydevjythonrcp

Eclipse RCP and Jython


I'm writing an eclipse RCP application and want to integrate Jython with it. I'm already able to launch the pydev python console using the Console view and choosing PyDev -> Python console. But when trying to launch Jython I get a series of exceptions: Launching Jython

Jython does work in my Eclipse but not in my Eclipse application.

This is what I get:

!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$0(PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory$1.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$0(PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory$1.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$0(PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory$1.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$0(PydevConsoleFactory.java:136)
    at org.python.pydev.debug.newconsole.PydevConsoleFactory$1.run(PydevConsoleFactory.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

In my imported packages I have org.python.pydev.core and org.python.pydev.debug.newconsole.

Any help will be greatly appreciated.


Solution

  • Looks like you're missing xerces library, try including them in your classpath