Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » LinkageError with OSGI Bundle
LinkageError with OSGI Bundle [message #1858297] Tue, 28 March 2023 00:24 Go to next message
Vladimir Guan is currently offline Vladimir GuanFriend
Messages: 2
Registered: March 2023
Junior Member
Hi All,

I have two OSGI bundles, both use play.mvc.http.Request. One bundle, say A, contains an interface, say AA with the a method, say, processRequest that has Request as a parameter.

The other bundle, say, B, has class, say, BB which calls AA.processRequest(request).

Both SBT files dependsOn the same version of com.typesafe.play (2.8.19) and both export play.* using OsgiKeys.exportPackage

The IDE indicates that both instances of Request are from the same version. However, I get the following runtime error:

Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method 'AA.processRequest(play.mvc.Http$Request)' the class loader
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @33df927e of the current class, BB, and the class loader
play.runsupport.NamedURLClassLoader @6fa3420 for the method's defining class, AA, have different Class objects for the type play/mvc/Http$Request used in the signature (BB is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @33df927e, parent loader 'bootstrap'; BB is in unnamed module of loader play.runsupport.NamedURLClassLoader @6fa3420, parent loader play.runsupport.classloader.DelegatingClassLoader @2d7a11d2)

Any help appreciated.

Cheers,
Vlad
Re: LinkageError with OSGI Bundle [message #1858304 is a reply to message #1858297] Tue, 28 March 2023 05:50 Go to previous message
Vladimir Guan is currently offline Vladimir GuanFriend
Messages: 2
Registered: March 2023
Junior Member
So, there was a hint to expose the package play.mvc in the main app as it is available there and then import it in the plugins. So I have tried the following:
1. Added -Dorg.osgi.framework.system.packages.extra=play.mvc
2. Added the above to .sbtopts file

Now I get org.osgi.framework.BundleException indicating that it is unable to resolve BB because of missing requirement play.mvc

If I export play in the bundle then I get the linkageerror.

Cheers,
Vlad
Previous Topic:Calling Extension Point Schema Compiler Headless
Next Topic:How to remove dependency to XServer in Linux for RCP product
Goto Forum:
  


Current Time: Wed Apr 24 19:18:01 GMT 2024

Powered by FUDForum. Page generated in 0.03238 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top