OSGi and Java 8 bundles are not compatible

Description

When trying to load both hibernate-osgi and hibernate-java8 I get the following error:

I need to use both in my project but I cannot work around this without resorting to the shade plugin.

Thanks,
Marcin

Environment

None

Activity

Show:
Ivo Leitao
March 29, 2016, 11:37 AM
Edited

I stumbled upon the same issue today. Any change of publishing a full jdk8 hibernate-core artifact merged with hibernate-java8 ? I think this is the fastest way to correct this issue. OSGI users will have to resort to something like this anyway which means custom made dependencies .

I'm of course not fully aware of the implications of what I'm asking, probably this means more work than I think. Perhaps I'm missing some other way to solve this at least till a another solution is adopted ?

Steve Ebersole
March 29, 2016, 12:04 PM

Brett, sorry missed your question here. If they want to use Java 8 inside the OSGi container and they want to use the Hibernate Java 8 date/time support they'd need that jar.

Ultimately we will have to split the package I think for this to work. That just sucks though because eventually this will get merged back into hibernate-orm once we move to Java 8 as the base JRE.

Ivo, it's not as simple as moving those classes into hibernate-orm as that would mean hibernate-hibernate-orm would need Java 8 at least to compile.

Brett Meyer
March 31, 2016, 12:11 AM

Hey , no sweat. So, technically, we can support "split" packages (exporting a package from multiple bundles), as long as those packages don't expose two of the same class name. It's mainly a matter of an additional instruction in the manifest. However, I'd highly advise skipping that if at all possible, as it tends to start a rabbit hole of problems. Especially if ORM 6.0 will be soonish and will natively support Java 8, I'd vote to punt on this. Just my $.02. If you guys think there's "enough" of a reason to support this in 5.x, I can play with it...

Brett Meyer
March 31, 2016, 10:03 PM

Based on the mailing list discussions and master aligning with Java 8, killing this one. Let me know if anyone disagrees.

Steve Ebersole
April 1, 2016, 1:42 PM

Thats reasonable to me. Its already done in master, btw, and published already as a 6.0.0-SNAPSHOT

Assignee

Brett Meyer

Reporter

Marcin Bujar

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure