I was getting the following error while trying to run a JUnit plug-in test case:

java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name XXX

My test case was written in a runtime Eclipse application using a plugin I had created, which had dependencies from JAR files in the /lib folder.

The solution was to go to the development environment for the Eclipse plugin that I was using (org.openiaml.model.tests in my case), going into the MANIFEST.MF editor, and following through the “Organise Manifests Wizard”.

This added a whole bunch of “Export-Package” entries to the MANIFEST.MF, which appeared to be a list of all the packages that the plugin itself would require to run.

I guess I now have to do this to all of my plugins…

(A little bit of inspiration from

It may also help to follow the discussion at, in particular the third party deployment guidelines at