1 Reply Latest reply: Mar 10, 2013 12:34 AM by 981815 RSS

    Passivation EJB statefull with PersistenceContextType.EXTENDED in WLS 12c

    945143
      Hi guys,

      I have one web app with some EJB stateful working under Weblogic 12c.

      A snippet of code:

      public abstract class CommonHibernateDao<T extends AbstractModel, K extends Serializable> {

           private static final Logger LOGGER = LoggerFactory.getLogger(GenericHibernateDao.class);

           @PersistenceContext(type = PersistenceContextType.EXTENDED)
           protected transient EntityManager em;
           protected transient Session session;
           @SuppressWarnings("unused")
           private Class<T> persistentClass;

      // common method like save delete...
      }

      @Stateful(name = "myDao")
      public class MyDaoImpl extends CommonHibernateDao<Pojo, Serializable> implements MyDao, Serializable {

      // methods with specific querys
      }

      In Glassfish 3.1.2 works fine, but in Weblogic 12c not.

      What is happened?

      When in Weblogic 12c the passivation the EJB throw one exception:

      Message: <BEA-010024> <Error occurred during passivation: java.io.NotSerializableException: weblogic.persistence.ExtendedPersistenceContextWrapper

      Stack: at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
           at java.util.HashSet.writeObject(HashSet.java:267)
           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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
           at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
           at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
           at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
           at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
           at weblogic.ejb.container.swap.PassivationUtils.write(PassivationUtils.java:101)
           at weblogic.ejb.container.swap.DiskSwap.write(DiskSwap.java:173)
           at weblogic.ejb.container.manager.StatefulSessionManager.swapOut(StatefulSessionManager.java:1582)
           at weblogic.ejb.container.cache.LRUCache.put(LRUCache.java:149)
           at weblogic.ejb.container.manager.StatefulSessionManager.create(StatefulSessionManager.java:1246)
           at weblogic.ejb.container.manager.StatefulSessionManager.createBean(StatefulSessionManager.java:1313)
           at weblogic.ejb.container.internal.StatefulEJBLocalHomeImpl.createBeanAndReturnPK(StatefulEJBLocalHomeImpl.java:112)
           at weblogic.ejb.container.internal.StatefulSessionBeanReferenceImpl.getBusinessObject(StatefulSessionBeanReferenceImpl.java:39)
           at com.oracle.injection.integration.EjbDescriptorAdapter$EjbInstanceManagerAdapter.getEjbInstance(EjbDescriptorAdapter.java:236)
           at com.oracle.injection.provider.weld.WeldEjbServicesAdapter.resolveEjb(WeldEjbServicesAdapter.java:45)
           at org.jboss.weld.bean.SessionBean.createReference(SessionBean.java:406)
           at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.<init>(EnterpriseBeanProxyMethodHandler.java:69)
           at org.jboss.weld.bean.SessionBean.create(SessionBean.java:293)
           at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:630)
           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:691)
           at org.jboss.weld.injection.ParameterInjectionPoint.getValueToInject(ParameterInjectionPoint.java:120)
           at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:217)
           at org.jboss.weld.injection.MethodInjectionPoint.invoke(MethodInjectionPoint.java:111)
           at org.jboss.weld.util.Beans.callInitializers(Beans.java:712)
           at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:701)
           at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:156)
           at com.oracle.injection.provider.weld.WeldInjectionServicesAdapter.aroundInject(WeldInjectionServicesAdapter.java:88)
           at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:45)
           at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:152)
           at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:126)
           at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:148)
           at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:285)
           at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:61)
           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:630)
           at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:657)