Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError(java.lang.IncompatibleClassChangeError: Class org.hibernate.jpa.internal.EntityManagerFactoryImpl does not implement the requested interface javax.persistence.EntityManagerFactory)
[Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1625644] Fri, 20 February 2015 14:36 Go to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
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 #1634485 is a reply to message #1625644] Wed, 25 February 2015 09:42 Go to previous messageGo to next message
Stefanie Müller is currently offline Stefanie MüllerFriend
Messages: 7
Registered: November 2014
Junior Member
Same problem here...
Any help will be appreciated.

Thanks in advance!

Regards, Steffi
Re: [Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1636443 is a reply to message #1634485] Thu, 26 February 2015 07:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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 #1636647 is a reply to message #1636443] Thu, 26 February 2015 09:47 Go to previous messageGo to next message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
Hi Martin,

thank you very much - I very much appreciate your help! It would be great, if we could find a solution for this weired problem. We would really like to switch to the JPA-based DB-access instead of using the Hibernate-Session-based one.

I am available for further research and analysis if required to solve the issue.

Cheers
Timo
Re: [Teneo] Using JPA with Teneo 2.1.0 causes IncompatibleClassChangeError [message #1641004 is a reply to message #1636647] Sat, 28 February 2015 10:46 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
The test project worked for me. But I changed the hibernate plugin to not have the javax.persistence jar anymore. I did
a testbuild and it seems to work fine.

The new plugin is available from the standard update site, it's version number is 4.3.7.1:
http://www.elver.org/eclipse/2.1.0/update/

Can you test/let me know if it works?

gr. Martin

On 26-02-15 10:47, Timo Rohrberg wrote:
> Hi Martin,
>
> thank you very much - I very much appreciate your help! It would be great, if we could find a solution for this weired
> problem. We would really like to switch to the JPA-based DB-access instead of using the Hibernate-Session-based one.
>
> I am available for further research and analysis if required to solve the issue.
>
> Cheers
> Timo


--

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 07:26 Go to previous message
Timo Rohrberg is currently offline Timo RohrbergFriend
Messages: 69
Registered: September 2011
Location: Karlsruhe
Member
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
Previous Topic:[EMFForms] Link Element
Next Topic:[EMF Generator] Headless Code Generation With Resource References Fails
Goto Forum:
  


Current Time: Wed Apr 24 13:51:00 GMT 2024

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

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

Back to the top