GMF eclipse exception

1.7k Views Asked by At

I'm trying to produce the gmf editor from an ecore meta-model. I'm following mainly this tutorial. I have getting the below error when I'm trying to run the gmf as Eclipse application.

eclipse.buildId=unknown
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -application test.diagram.TestApplication
Command-line arguments:  -application test.diagram.TestApplication -data C:\Program Files (x86)\eclipse epsilon\workspace/../runtime-test.diagram.TestApplication -dev file:C:/Program Files (x86)/eclipse epsilon/workspace/.metadata/.plugins/org.eclipse.pde.core/test.diagram.TestApplication/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.gmf.runtime.diagram.ui.printing.render 4 0 2014-08-03 13:42:06.118
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.gmf.runtime.diagram.ui.printing.render [33]
  Unresolved requirement: Require-Bundle: org.eclipse.gmf.runtime.draw2d.ui.render.awt; bundle-version="[1.2.0,2.0.0)"
    -> Bundle-SymbolicName: org.eclipse.gmf.runtime.draw2d.ui.render.awt; bundle-version="1.8.0.201406111639"; singleton:="true"
       org.eclipse.gmf.runtime.draw2d.ui.render.awt [81]
         Unresolved requirement: Require-Bundle: org.apache.batik.ext.awt; bundle-version="[1.6.0,1.7.0)"
           -> Bundle-SymbolicName: org.apache.batik.ext.awt; bundle-version="1.6.0.v201011041432"
              org.apache.batik.ext.awt [7]
                Unresolved requirement: Require-Bundle: org.apache.batik.util; bundle-version="[1.6.0,1.7.0)"

    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:1561)
    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)

Any idea?

2

There are 2 best solutions below

0
On

There is a problem with conflicting dependencies in Eclipse Luna SR1. The solution I found for this problem is the following:

  • Go to the MANIFEST.MF of your diagram project and remove the dependency to: org.eclipse.gmf.runtime.diagram.ui.render

This removes your error but another error can appear if you are using Java 7. The problem is in the org.eclipse.jdt.annotation 2.x library which requires Java 8. To solve this you need to:

  • Go to Run -> Configurations
  • Select the tab "Plug-ins"
  • Choose "plug-ins selected below only" next to "Launch with"
  • Click "Deselect all"
  • Click "Add required plugins" (for this button to be enabled the search box needs to be empty)
  • Uncheck org.eclipse.jdt.annotation 2.x
  • Check org.eclipse.jdt.annotation 1.x
  • Apply and run.

The GMF editor can be launched. There will be an exception written to the console because of the missing dependency, but it doesn't seem to make a difference (unless for me)

0
On

I had the same issue, the cause was that both versions 1.6 and 1.7 of Apache Batik were enabled on launch. Based on Edumundos solution, this solved my problem:

In the run configuration plugins tab, search for batik. There are multiple plugins with the same name but different versions. Disable all that are version 1.6.