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 Messages: 19 Registered: December 2015 |
Junior Member |
|
|
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:
...
org.apache.felix.gogo.command,\
org.apache.felix.gogo.shell,\
org.apache.felix.gogo.runtime,\
org.apache.felix.log,\
...
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):
org.apache.felix.configadmin,\
org.apache.felix.gogo.command,\
org.apache.felix.gogo.shell,\
org.apache.felix.gogo.runtime,\
org.apache.felix.log,\
org.apache.felix.scr,\
org.eclipse.core.jobs,\
org.eclipse.core.net,\
org.eclipse.ecf,\
org.eclipse.ecf.filetransfer,\
org.eclipse.ecf.identity,\
org.eclipse.ecf.provider.filetransfer,\
org.eclipse.equinox.common,\
org.eclipse.equinox.metatype,\
org.eclipse.equinox.p2.artifact.repository,\
org.eclipse.equinox.p2.core,\
org.eclipse.equinox.p2.engine,\
org.eclipse.equinox.p2.jarprocessor,\
org.eclipse.equinox.p2.metadata,\
org.eclipse.equinox.p2.metadata.repository,\
org.eclipse.equinox.p2.repository,\
org.eclipse.equinox.p2.transport.ecf,\
org.eclipse.equinox.preferences,\
org.eclipse.equinox.registry,\
org.eclipse.equinox.security,\
org.osgi.service.metatype,\
org.tukaani.xz
Any thoughts? More information which might be useful? Thanks for reading.
[Updated on: Tue, 07 June 2016 09:05] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Mon Dec 02 14:11:41 GMT 2024
Powered by FUDForum. Page generated in 0.06611 seconds
|