Skip to main content
Jump to: navigation, search

Running TimeService examples on Java7

ECF has a number of example product configurations in the TimeService remote services example (*.product files in the launch directories of these two bundles: com.mycorp.examples.timeservice.host and com.mycorp.examples.timeservice.consumer.ds).

There is a bug 461163 in PDE that when these product configurations are run/debugged PDE generates a launch config. Unfortunately, this bug means that when run in Eclipse on Java7, that the following exceptions will occur:

!SESSION 2015-03-06 10:32:41.721 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_11
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -application 
Command-line arguments:  -application  -data C:\Users\slewis\workspace.ecftest/../runtime-TimeServiceHost.generic.noreg.product -dev file:C:/Users/slewis/workspace.ecftest/.metadata/.plugins/org.eclipse.pde.core/TimeServiceHost.generic.noreg.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.ecf.remoteservice 4 0 2015-03-06 10:32:42.327
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ecf.remoteservice [5]
  Unresolved requirement: Import-Package: org.eclipse.ecf.remoteservice.asyncproxy; version="1.0.0"
    -> Export-Package: org.eclipse.ecf.remoteservice.asyncproxy; bundle-version="2.0.0.v20140410-1838"; bundle-symbolic-name="org.eclipse.ecf.remoteservice.asyncproxy"; version="2.0.0"
       org.eclipse.ecf.remoteservice.asyncproxy [6]
         Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.ecf.remoteservice.asyncproxy 4 0 2015-03-06 10:32:42.329
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.ecf.remoteservice.asyncproxy [6]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)


...additional dependency errors deleted

This exception is caused by PDE selecting the incorrect (2.0.0) version of the org.eclipse.ecf.remoteservices.asyncproxy bundle, which is depended upon by many other bundles (the other error messages). As per bug 461163 on Java7 PDE *should* select the 1.0.0 version of this bundle, but it always seems to select version 2.0.0. On Java8 2.0.0 is correct, but on Java7 this is incorrect and causes the above errors.

If you encounter this problem, it can be fixed by going through the following steps in Eclipse

  1. Via Eclipse menu, open the Run->Debug Configurations dialog
  2. Select the launch configuration generated by PDE (e.g. TimeServiceHost.generic.noreg.product)
  3. Select the Plugins tab
  4. In the filter type: *.async. This should show you two bundles: org.eclipse.ecf.remoteservice.asyncproxy (1.0.0) and org.eclipse.ecf.remoteservice.asyncproxy (2.0.0)
  5. Unselect the 2.0.0 version and select the 1.0.0 version
  6. Apply the Changes

You now should be able to successfully re-run this launch config.

Back to the top