[Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1625644] |
Fri, 20 February 2015 09:36  |
Eclipse User |
|
|
|
Hello everybody,
Hello Martin,
I am currently trying to use the EntityManager based JPA with Teneo 2.1.0. Unfortunately, I always get the following error when trying to create the EntityManagerFactory via the HbEntityDataStore:
java.lang.IncompatibleClassChangeError: Class org.hibernate.jpa.internal.EntityManagerFactoryImpl does not implement the requested interface javax.persistence.EntityManagerFactory
at org.eclipse.emf.teneo.hibernate.HbEntityDataStore$WrappedEntityManagerFactory.createEntityManager(HbEntityDataStore.java:456)
...
I created a simple self-contained minimal example using Teneo 2.1.0 (including transitive dependencies) from your website, plus the Eclipse Luna platform and Eclipse testing bundles. The example is attached to this post as a ZIP file containing the Eclipse project with test implementation, launch configuration, and the target platform. Please note the hibernate system properties for setting the target PostgreSQL database in the launch configuration.
As you can see the test just instantiates the HbEntityDataStore and tries to retrieve the EntityManager from it.
It seems that the org.hibernate.jpa.internal.EntityManagerFactoryImpl implementation does not match the corresponding EntityManagerFactory interface in the javax.persistence bundle. I figured that the javax.persistence package is also included in the hibernate-jpa-2.1-api bundle repackaged in the org.hibernate bundle. Is this correct?
Does anyone/Martin have any idea what is going wrong here?
Thanks for any hints.
Cheers
Timo
|
|
|
|
Re: [Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1636443 is a reply to message #1634485] |
Thu, 26 February 2015 02:32   |
Eclipse User |
|
|
|
Hi,
Somehow the original post did not show in my thunderbird news reader, so therefore the late reply.. Indeed as Timo
mentions I think it is also a classloading issue with the EntityManagerFactory used by hibernate coming from the
internal jar file in the hibernate bundle, while Teneo possibly loads it from a separate bundle.
The 'strange' thing is that this setup works fine for the Teneo build which also has a separate perssistence jar in its
target platform.
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ws/build/test/tp/plugins/
In any case I think the solution could be to get rid of the hibernate javax.persistence jar file. I will try the test
project provided by Timo. I am behind a somewhat slower internet connection for a couple of days, so it can take a
couple of days before I have uploaded a new hibernate version.
gr. Martin
On 25-02-15 10:42, Stefanie Müller wrote:
> Same problem here...
> Any help will be appreciated.
>
> Thanks in advance!
>
> Regards, Steffi
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
|
Re: [Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1644821 is a reply to message #1641004] |
Mon, 02 March 2015 02:26  |
Eclipse User |
|
|
|
Hi Martin,
I also tried the test project and it works now. I did not have the time yet to integrate the updated Teneo/Hibernate dependencies into our main project, as the minimal example reflected exactly the same situation, I guess, it should work now. If not, I'll come back to you here next week as I am off for a couple of days from tomorrow on.
Thank you very much for your help.
Cheers
Timo
|
|
|
Powered by
FUDForum. Page generated in 0.08914 seconds