Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Bug 566085 - javax.annotation package-uses problems with Java 8

Hi Mark.

I’ve added your comment to Bug 566085.

Brian.


On Aug 22, 2020, at 4:50 AM, Mark Hoffmann <mark.hoffmann@xxxxxx> wrote:



Hi,

I dont think that this is final solution for that problem.

The class finding search order is defined in OSGi:

https://docs.osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.overallsearchorder

That mean finding a class to be loaded will be initially done using the boot delegation (Step 2 in this case). If defined correctly the following will happen:

Java 1.8 - delegate to parent class loader an load javax.annotation from there (no matter, if you have an bundle provided for that package)

Java 11 - cannot find javax.annotation over boot-delegation, go on with Import-Package or Require-Bundle

Either provide a org.osgi.framework.bootdelegation=javax.* as property to activate boot-delegation or you can use the existing profiles instead.

The Profiles are defined in Equinox:

https://github.com/eclipse/rt.equinox.framework/blob/master/bundles/org.eclipse.osgi/JavaSE-1.8.profile

You can find the property: org.osgi.framework.bootdelegation there with a definition for javax.*

To make Equinox use this profile (I dont know, if this happens by default) via launcher, you should provide the osgi.java.profile="" class="moz-txt-link-freetext" href="file:///">file:/<your-path>/JavaSE-1.8.profile

If you take the profile, then you have to additionally provide the property: osgi.java.profile.bootdelegation=override, so that Equinox takes the profile boot delegation entries. instead of already defined ones

With the correct boot-delegation configuration, always that same class loader will be taken for this constellation, no matter, if in Java 1.8 or 11. The same applies to JAXB problems.

https://wiki.eclipse.org/Equinox_Boot_Delegation


Regards,

Mark


Am 21.08.20 um 22:43 schrieb Brian de Alwis:
Unfortunately javax.annotation package-uses issues have returned :(  


The issue only occurs on Java 8 and has been seen in the wild.  I suspect it has not been more widespread due to increased adoption of Java 11.

I’ve pushed up a fix to the javax.annotation 1.3.5 bundle.  I think the risk is small, but given that we’re in RC season, it would be good to get some more eyes on this.

If you have concerns, please comment on Bug 566085.

Brian.

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/equinox-dev
--
Mark Hoffmann

E-Mail: mark.hoffmann@xxxxxx

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/equinox-dev

Back to the top