tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien ARBOGAST <sebastien.arbog...@gmail.com>
Subject AbstractMethodException with Hibernate 3.4.0.GA
Date Thu, 06 May 2010 13:48:57 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message