You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Karl-Philipp Richter <kr...@aol.de> on 2014/01/13 20:20:59 UTC
Hibernate + OpenEJB in embedded unit testing
Hi together,
I'm trying to get Hibernate 4.3.0.Final and OpenEJB 4.6.0 to work in
embedded unit testing (example application attached which works
perfectly with OpenJPA 2.2.2). Hibernate 4.3.0.Final needs the
hibernate.transaction.jta.platform
property (e.g. in glassfish deployment, I've to set it to
org.hibernate.service.jta.platform.internal.SunOneJtaPlatform
, otherwise I get
<code>
java.lang.NullPointerException
at
org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
</code>
(see a detailed description for jboss solution on
http://stackoverflow.com/questions/18822165/cannot-create-entity-manager-jboss7-liferay-6-0-oracle-datasource
for jboss
). I was wondering whether something similar exists for OpenEJB. Maybe
somebody knows whether one of the entries on
https://docs.jboss.org/hibernate/core/4.3/devguide/en-US/html/ch07.html#services-JtaPlatform
work.
Any help is appreciated.
Is there a guide on Hibernate + OpenEJB?
All the best,
Karl
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Romain Manni-Bucau <rm...@gmail.com>.
in fact it is OpenEJBJtaPlatform2 for hibernate 4.3
Le mercredi 15 janvier 2014, Karl-Philipp Richter <kr...@aol.de> a
écrit :
> Hi,
> I cannot confirm that Hibernate 4.3 works with
> org.apache.openejb.hibernate.OpenEJBJtaPlatform as value for the
> hibernate.transaction.jta.platform property (internal Hibernate error
> due to package rename as described in my previous mail), but if I set it
to
> org.hibernate.service.jta.platform.internal.BitronixJtaPlatform
> it works (tested with hsqldb 2.3.0 and postgres 9.3-jdbc4).
>
> Thanks a lot!
>
> Kind regards,
> Karl
>
> On 14.01.2014 07:15, Romain Manni-Bucau wrote:
>> Hi
>>
>> As stated in my last mail it works on trunk (it should be deployed now i
>> think) with hibernate 4.3 but released versions only support 4.2 and
>> previous. You can just impl yourself the jtaplatform btw but not as nice
as
>> it is normally ... or use hib 4.2.
>>
>>
>
>
--
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau
<http://fr.linkedin.com/in/rmannibucau>*
*Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Karl-Philipp Richter <kr...@aol.de>.
Hi,
I cannot confirm that Hibernate 4.3 works with
org.apache.openejb.hibernate.OpenEJBJtaPlatform as value for the
hibernate.transaction.jta.platform property (internal Hibernate error
due to package rename as described in my previous mail), but if I set it to
org.hibernate.service.jta.platform.internal.BitronixJtaPlatform
it works (tested with hsqldb 2.3.0 and postgres 9.3-jdbc4).
Thanks a lot!
Kind regards,
Karl
On 14.01.2014 07:15, Romain Manni-Bucau wrote:
> Hi
>
> As stated in my last mail it works on trunk (it should be deployed now i
> think) with hibernate 4.3 but released versions only support 4.2 and
> previous. You can just impl yourself the jtaplatform btw but not as nice as
> it is normally ... or use hib 4.2.
>
>
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
As stated in my last mail it works on trunk (it should be deployed now i
think) with hibernate 4.3 but released versions only support 4.2 and
previous. You can just impl yourself the jtaplatform btw but not as nice as
it is normally ... or use hib 4.2.
--
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau
<http://fr.linkedin.com/in/rmannibucau>*
*Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Karl-Philipp Richter <kr...@aol.de>.
Hi Romain,
thanks for your help! The new hibernate package structure seems to cause
java.lang.ClassNotFoundException:
org.hibernate.service.jta.platform.internal.AbstractJtaPlatform
in the trunk version. This class is available under this name until 4.2,
I guess and seems to be called
org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform
in 4.3 according to
http://docs.jboss.org/hibernate/orm/4.3/javadocs/org/hibernate/engine/transaction/jta/platform/internal/AbstractJtaPlatform.html
. I tried my sample with both org.hibernate.ejb.HibernatePersistence and
org.hibernate.jpa.HibernatePersistenceProvider. Am I missing something
or is the Hibernate support not ready yet (and should I CC the dev-list)?
Kind regards,
Karl
On 13.01.2014 22:30, Romain Manni-Bucau wrote:
> btw we don't support hibernate 4.3 (hibernate changed packages between
> 4.x and 4.3 it seems) that's fixed on trunk btw
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014/1/13 Romain Manni-Bucau <rm...@gmail.com>:
>> using <provider>org.hibernate.ejb.HibernatePersistence</provider> all
>> will be done automatically otherwise
>> org.apache.openejb.hibernate.OpenEJBJtaPlatform as jtaplatform
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014/1/13 Karl-Philipp Richter <kr...@aol.de>:
>>> Hi together,
>>> I'm trying to get Hibernate 4.3.0.Final and OpenEJB 4.6.0 to work in
>>> embedded unit testing (example application attached which works
>>> perfectly with OpenJPA 2.2.2). Hibernate 4.3.0.Final needs the
>>> hibernate.transaction.jta.platform
>>> property (e.g. in glassfish deployment, I've to set it to
>>> org.hibernate.service.jta.platform.internal.SunOneJtaPlatform
>>> , otherwise I get
>>> <code>
>>> java.lang.NullPointerException
>>> at
>>> org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
>>> </code>
>>> (see a detailed description for jboss solution on
>>> http://stackoverflow.com/questions/18822165/cannot-create-entity-manager-jboss7-liferay-6-0-oracle-datasource
>>> for jboss
>>> ). I was wondering whether something similar exists for OpenEJB. Maybe
>>> somebody knows whether one of the entries on
>>> https://docs.jboss.org/hibernate/core/4.3/devguide/en-US/html/ch07.html#services-JtaPlatform
>>> work.
>>> Any help is appreciated.
>>> Is there a guide on Hibernate + OpenEJB?
>>>
>>> All the best,
>>> Karl
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Romain Manni-Bucau <rm...@gmail.com>.
btw we don't support hibernate 4.3 (hibernate changed packages between
4.x and 4.3 it seems) that's fixed on trunk btw
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014/1/13 Romain Manni-Bucau <rm...@gmail.com>:
> using <provider>org.hibernate.ejb.HibernatePersistence</provider> all
> will be done automatically otherwise
> org.apache.openejb.hibernate.OpenEJBJtaPlatform as jtaplatform
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014/1/13 Karl-Philipp Richter <kr...@aol.de>:
>> Hi together,
>> I'm trying to get Hibernate 4.3.0.Final and OpenEJB 4.6.0 to work in
>> embedded unit testing (example application attached which works
>> perfectly with OpenJPA 2.2.2). Hibernate 4.3.0.Final needs the
>> hibernate.transaction.jta.platform
>> property (e.g. in glassfish deployment, I've to set it to
>> org.hibernate.service.jta.platform.internal.SunOneJtaPlatform
>> , otherwise I get
>> <code>
>> java.lang.NullPointerException
>> at
>> org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
>> </code>
>> (see a detailed description for jboss solution on
>> http://stackoverflow.com/questions/18822165/cannot-create-entity-manager-jboss7-liferay-6-0-oracle-datasource
>> for jboss
>> ). I was wondering whether something similar exists for OpenEJB. Maybe
>> somebody knows whether one of the entries on
>> https://docs.jboss.org/hibernate/core/4.3/devguide/en-US/html/ch07.html#services-JtaPlatform
>> work.
>> Any help is appreciated.
>> Is there a guide on Hibernate + OpenEJB?
>>
>> All the best,
>> Karl
Re: Hibernate + OpenEJB in embedded unit testing
Posted by Romain Manni-Bucau <rm...@gmail.com>.
using <provider>org.hibernate.ejb.HibernatePersistence</provider> all
will be done automatically otherwise
org.apache.openejb.hibernate.OpenEJBJtaPlatform as jtaplatform
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014/1/13 Karl-Philipp Richter <kr...@aol.de>:
> Hi together,
> I'm trying to get Hibernate 4.3.0.Final and OpenEJB 4.6.0 to work in
> embedded unit testing (example application attached which works
> perfectly with OpenJPA 2.2.2). Hibernate 4.3.0.Final needs the
> hibernate.transaction.jta.platform
> property (e.g. in glassfish deployment, I've to set it to
> org.hibernate.service.jta.platform.internal.SunOneJtaPlatform
> , otherwise I get
> <code>
> java.lang.NullPointerException
> at
> org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
> </code>
> (see a detailed description for jboss solution on
> http://stackoverflow.com/questions/18822165/cannot-create-entity-manager-jboss7-liferay-6-0-oracle-datasource
> for jboss
> ). I was wondering whether something similar exists for OpenEJB. Maybe
> somebody knows whether one of the entries on
> https://docs.jboss.org/hibernate/core/4.3/devguide/en-US/html/ch07.html#services-JtaPlatform
> work.
> Any help is appreciated.
> Is there a guide on Hibernate + OpenEJB?
>
> All the best,
> Karl