2 Replies Latest reply on Apr 4, 2007 12:50 PM by Ray Ploski

    Exception while clustering seam-booking demo

    Ray Ploski Newbie

      I'm running into an issue with clustering the sample application seam-booking on JBoss AS 4.0.5GA with Seam 1.2.0-PATCH1. Most portions of the application work great except when clicking [more results] link from the Hotel Search page after a node fail-over. The error shown in the logs is

      Caused by: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of org.jboss.seam.persistence.EntityManagerProxy - org.jboss.seam.persistence.EntityManagerProxy
      at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:367)
      at org.jboss.ejb3.stateful.StatefulBeanContext.getInstance(StatefulBeanContext.java:309)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:77)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
      at $Proxy151.nextPage(Unknown Source)
      at org.jboss.seam.example.booking.HotelSearching$$FastClassByCGLIB$$9804fd0e.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:74)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
      at org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:37)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
      at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
      at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
      at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:52)
      at org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$a222daf1.nextPage()
      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:585)
      at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
      ... 49 more


      I've enabled seam-booking to work in a clustered environment by modifying the following:

      Added the annotation @Clustered to all the EJB3 Stateful Session Beans (HotelSearchingAction.java,
      AuthenticatorAction.java, HotelBookingAction.java, ChangePasswordAction.java, BookingListAction.java and
      ChangePassword.java ).

      Added the annotation @Cache to all entities with the usage=TRANSACTIONAL for all entites except Hotel whose usage=READ_ONLY.

      Removed the bookingDatasourceBootstrap MBean from META-INF/jboss-beans.xml and modified booking-ds.xml to have each node connect to a shared hsqldb server instance.

      Added the following lines to META-INF/persistence.xml for entity caching
      <!-- Clustered cache with TreeCache -->