tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jean-louis.monte...@atosorigin.com>
Subject Re: AbstractMethodException with Hibernate 3.4.0.GA
Date Wed, 12 May 2010 07:43:12 GMT

Hi Sebastien,

The #getTransactionIdentifier(Transaction tx) is a new method of the
Hibernate API.
Here is the javadoc 
http://docs.jboss.org/hibernate/stable/core/api/org/hibernate/transaction/TransactionManagerLookup.html#getTransactionIdentifier(javax.transaction.Transaction)
http://docs.jboss.org/hibernate/stable/core/api/org/hibernate/transaction/TransactionManagerLookup.html#getTransactionIdentifier(javax.transaction.Transaction)


I pushed a JIRA ( https://issues.apache.org/jira/browse/OPENEJB-1276
https://issues.apache.org/jira/browse/OPENEJB-1276 ) and i gonna try to fix
it today.

Jean-Louis



Sebastien ARBOGAST wrote:
> 
> I'm using OpenEJB in combination with Hibernate 3.4.0.GA to unit test my
> EJB's.
> Ever since I upgraded to this version of Hibernate, when I run the
> following
> code:
> 
> public T findByExample(final T exampleInstance) {
>         Session session = getHibernateSession();
>         Criteria crit = session.createCriteria(entityClass);
>         crit.add(Example.create(exampleInstance));
>         return (T) crit.uniqueResult();
>     }
> 
>     private Session getHibernateSession() {
>         if (factory instanceof EntityManagerFactoryImpl) {
>             return ((EntityManagerFactoryImpl)
> factory).getSessionFactory().getCurrentSession();
>         } else if (entityManager.getDelegate() instanceof Session) {
>             return (Session) entityManager.getDelegate();
>         } else throw new RuntimeException("Cannot retrieve Hibernate
> session");
>     }
> 
> I get the following exception:
> 
> javax.ejb.EJBTransactionRolledbackException: The transaction has been
> marked
> rollback only because the bean encountered a non-application exception
> :java.lang.AbstractMethodError :
> org.apache.openejb.hibernate.TransactionManagerLookup.getTransactionIdentifier(Ljavax/transaction/Transaction;)Ljava/lang/Object;
>     at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:340)
>     at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
>     at $Proxy47.findAllByExample(Unknown Source)
>     at
> org.ellixxir.lxr.xeos.business.impl.EconomicOperatorServiceBean.retrieve(EconomicOperatorServiceBean.java:172)
>     ... 43 more
> Caused by: java.lang.AbstractMethodError:
> org.apache.openejb.hibernate.TransactionManagerLookup.getTransactionIdentifier(Ljavax/transaction/Transaction;)Ljava/lang/Object;
>     at
> org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:122)
>     at
> org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)
>     at
> org.ellixxir.lxr.xeos.dao.hibernate.HibernateBaseDaoImpl.getHibernateSession(HibernateBaseDaoImpl.java:54)
>     at
> org.ellixxir.lxr.xeos.dao.hibernate.HibernateBaseDaoImpl.findAllByExample(HibernateBaseDaoImpl.java:62)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
>     at
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
>     at
> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:122)
>     at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:221)
>     at
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:174)
>     at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
>     at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
>     at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:281)
> 
> Is it a known bug? Any idea what this means?
> 
> S├ębastien Arbogast
> 
> 

-- 
View this message in context: http://openejb.979440.n4.nabble.com/AbstractMethodException-with-Hibernate-3-4-0-GA-tp2132656p2195697.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message