0

I have an xtext project that uses a third-party library (jgrapht). I (have to) inject the relevant jgrapht classes and this works fine when I test my xtext compiler using the accompanying xtext test project.

However, when I try to run as -> eclipse application I get a NoClassDefFoundError inspite of the fact that the .jars are included in the main xtext project and the IDE project.

From what I have read, I should "add a dependency to the package or bundle that provides those classes." When I use eclipse to resolve dependencies, however, it makes no changes. When I try and manually add the package to Import-Package in projectx/META-INF/MANIFEST.MF "No available bundle exports org.jgrapht.DirectedGraph" and likewise for the other dependencies. Exporting the package, in case it is required when I run as an Eclipse app, tells me the package does not exist in the plug-in. Adding it to require-bundle, I get told it cannot be resolved. All in spite of the fact that the packages are used fine when testing the project.

Thank you if you can assist.

The partial exception trace is (my xtext project is projectx):

13   [Worker-2] ERROR org.eclipse.xtext.internal.ResourceServiceProviderDescriptor  - org/jgrapht/graph/DefaultDirectedGraph
java.lang.NoClassDefFoundError: org/jgrapht/graph/DefaultDirectedGraph
    at projectx.ToscaRuntimeModule.configure(ToscaRuntimeModule.java:22)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.spi.Elements.getElements(Elements.java:101)
    at com.google.inject.spi.Elements.getElements(Elements.java:92)
    at com.google.inject.util.Modules$RealOverriddenModuleBuilder$1.configure(Modules.java:152)
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
    at com.google.inject.spi.Elements.getElements(Elements.java:101)
Dr. Thomas C. King
  • 993
  • 2
  • 15
  • 28

0 Answers0