Home » Eclipse Projects » P2 » Huge variety of ClassNotFoundExceptions trying to load P2 repositories(Using P2 as a standalone product with minimal set of bundles in restricted environment)
|Huge variety of ClassNotFoundExceptions trying to load P2 repositories [message #1734287]
||Mon, 06 June 2016 19:00
| Elias Vasylenko
Registered: December 2015
Hi, I hope someone can give me a few pointers here, I am trying to get a small tool working which can interact with P2 repositories. Due to certain constraints wrt how I can approach this, currently I'm getting a framework instance via FrameworkFactory and installing and starting a minimal set of bundles manually.|
For the most part this seems to be working fine, and I have the framework & bundle class loaders configured so I can pull the query results back out of the framework and make them accessible in the host (non-OSGi) class loader, but under certain circumstances I'm getting a lot of confusing class loading errors when I try to invoke IMetadataRepositoryManager::loadRepository or IArtifactRepositoryManager::loadRepository, e.g:
java.lang.ClassNotFoundException: org.eclipse.equinox.internal.p2.engine.ProfilePreferences cannot be found by org.eclipse.equinox.p2.metadata.repository_1.2.200.v20150428-1613
java.lang.ClassNotFoundException: org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepositoryFactory cannot be found by org.eclipse.equinox.preferences_3.5.300.v20150408-1437
java.lang.ClassNotFoundException: org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace cannot be found by org.eclipse.equinox.p2.artifact.repository_1.1.400.v20150513-2116
... and many more similar.
I've tried rearranging the bundle start order in all the different permutations I can think of, including based on the start levels of some existing eclipse products, but nothing seems to make a difference. I just end up with a bunch of slightly different class loading errors.
The only thing that I've found to work is adding the following bundles to the framework, after which all my unit tests magically start to pass:
But I have absolutely no clue why this could be. What relationship could the gogo shell have to those errors? I've tried swapping them out of a bunch of different logging implementations and stuff as a shot in the dark, but it has to be those bundles. And I'd rather not ship them as part of the finished product, as they really have no business being there...
Here is the full (working) set of bundles I'm deploying (minus a couple of unrelated of my own):
Any thoughts? More information which might be useful? Thanks for reading.
[Updated on: Tue, 07 June 2016 09:05]
Report message to a moderator
Current Time: Sun Sep 23 03:09:33 GMT 2018
Powered by FUDForum
. Page generated in 0.01571 seconds