1 Reply Latest reply on Aug 8, 2011 3:02 AM by Thierry Peng

    seam-wicket 3.0.0, Glassfish 3.1.1, EJB and Serializable Exception

    Thierry Peng Newbie

      Hello


      I'm developing an application with Glassfish 3.1.1, Wicket 1.4.17, the seam-wicket integration with the version 3.0.0.Final.


      I made a simple ejb as following:


      @Stateless
      public class NewSampleStatelessBean implements Serializable{
         
          public String isEjbAlive()
          {
              return hell, yes!;
          }
         
      }


      A simple Wicket Webpage with an
      @Inject NewSampleStatelessBean sample;


      and of course I extended the SeamApplication in the Wicketapplication.
      The injection itself works, but with the serialization of the page (as wicket handle the page/component history), an exception occurs:




      org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: ch.glue.ejb.__EJB31_Generated__NewSampleStatelessBean__Intf____Bean__
      Field hierarchy is:
        0 [class=ch.glue.wicket.pages.HomePage, path=0]
          private ch.glue.ejb.NewSampleStatelessBean ch.glue.wicket.pages.HomePage.stateLessBean [class=ch.glue.ejb.org$jboss$weld$bean-test-SessionBean-NewSampleStatelessBean_$$_WeldProxy]
            private ch.glue.ejb.NewSampleStatelessBean ch.glue.wicket.pages.HomePage.stateLessBean[write:1][write:2][write:3][write:4] [class=org.jboss.weld.bean.proxy.ProxyMethodHandler]
              private org.jboss.weld.bean.proxy.BeanInstance org.jboss.weld.bean.proxy.ProxyMethodHandler.beanInstance [class=org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance]
                private final javassist.util.proxy.MethodHandler org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.methodHandler [class=org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler]
                  private final org.jboss.weld.ejb.api.SessionObjectReference org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.reference [class=org.glassfish.weld.ejb.SessionObjectReferenceImpl]
                    private java.lang.Object org.glassfish.weld.ejb.SessionObjectReferenceImpl.ejbRef [class=ch.glue.ejb.__EJB31_Generated__NewSampleStatelessBean__Intf____Bean__] <----- field that is not serializable





      There are some threads around, mostly unanswered like
      http://apache-wicket.1842946.n4.nabble.com/De-serializing-injected-beans-td3677497.html or
      http://seamframework.org/Community/NonSerializableFieldInInjectedSLSB


      or some rumors that the javassist either in weld or glassfish has a bug like
      http://seamframework.org/Community/SerializationProblemWithCDIEJBAndProxies


      glassfish 3.1.1 seems to have the weld implementation 1.1.1, so this mentioned javassist bug should be solved.


      As it seems either the Glassfish or Weld produce not serializable proxies for this ejb, and the question is who and what can be done about that problem.


      thanks for any help