0 Replies Latest reply on Jul 24, 2014 2:27 AM by Admin Godesys

    ClassCastException HibernateProxy with running liferay 6.2

    Admin Godesys Newbie

      Hi guys i have a very strange problem with jboss and lieferay. I use the jboss7.1 and liferay 6.2.

      If I deploy my own ear project and access my ejbs via remote or locale interface everything is fine.

      But if i now dodeploy the liferay root war, i get an

      java.lang.ClassCastException: Entity_$$_jvst1c4_ae cannot be cast to org.hibernate.proxy.HibernateProxy

      exception.

       

      My ear Projekt uses the following jboss-deployment-structure.xml:

      <deployment>

              <exclusions>

                  <module name="deployment.root.war" />

              </exclusions>

              <dependencies>

                  <module name="org.hibernate" export="true"/>

                  <module name="org.jboss.common-core" export="true" />

                  <module name="org.apache.velocity" export="true" />

                  <module name="javax.faces.api" export="true" />

                  <module name="org.apache.commons.io" export="true"/>

              </dependencies>

          </deployment>

       

      I exclude the liferay war explicit but think is not necessary and it changes nothing. I not other dependencies to these liferay root war.

      I think it could be a problem of liferay classloading? In the root.war i have found a hibernate3.jar but my ear and jboss uses hibernate4.

      The javassist.jar is the same in liferay and jboss (3.15GA).

      I dont understand whats going wrong. No Idea how an additional deployes war could influence my ear, i thought they are isolated by default.

      Any Ideas or similar behaviour? Need help, thanks a lot.

       

      Daniel

       

      Full Stacktrace:

      javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.HibernateException: Javassist Enhancement failed: com.godesys.business.crm.persistence.Employee

      org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)

      org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)

      org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)

      org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:80)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

        org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

      org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

      org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)

      org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:179)

      org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:179)

      org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:43)

      org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

      org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128)

      org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

      org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

      org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

      org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

      com.sun.proxy.$Proxy522.getUserByLoginname(Unknown Source)

       

      java.lang.ClassCastException: Entity_$$_jvst1c4_ae cannot be cast to org.hibernate.proxy.HibernateProxy

      org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:140)

      org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:73)

      org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:755)

      org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:4129)

      org.hibernate.event.internal.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:321)

      org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:249)

      org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148)

      org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954)

      org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:903)

      org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:610)

      org.hibernate.type.EntityType.resolve(EntityType.java:438)

      org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:150)

      org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1006)

      org.hibernate.loader.Loader.doQuery(Loader.java:883)

      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)

      org.hibernate.loader.Loader.doList(Loader.java:2463)

      org.hibernate.loader.Loader.doList(Loader.java:2449)

      org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)

      org.hibernate.loader.Loader.list(Loader.java:2274)

      org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)

      org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)

      org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)

      org.hibernate.internal.SessionImpl.list(SessionImpl.java:1115)

      org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)

      org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:280)