0 Replies Latest reply on Sep 29, 2009 10:49 PM by David Jitendranath

    Problem with Stateful bean - ViewExpiredException

    David Jitendranath Novice

      I have a stateful action that I'm invoking from my seam page.  Everytime the update() method is called I get a could not instantiate seam component exception. Here's my code.



      @Stateful
      @Name("gradeToLevelAction")
      public class GradeToLevelAction implements GradeToLevelActionLocal{     
      
           @PersistenceContext(unitName="#esam")
          private EntityManager entityManager;
      
           
           @DataModel
           private List<GradeToLevel> gradeToLevelList;
           
           @DataModelSelection
           private GradeToLevel gradeToLevel;
      
           public GradeToLevelAction() {
           }
           
           @Factory("gradeToLevelListEdit.resultList")
           public void find(){
                entityManager.createQuery("select gradeToLevel from GradeToLevel gradeToLevel").getResultList();          
           }
      
           public void update(){
      
                System.out.println("updating list ");
           }
           
           @Remove @Destroy
           public void destroy(){}     
      
      }



      With Local interface



      @Local
      public interface GradeToLevelActionLocal {
           public void update();
           public void destroy();
           public void find();
      }
      



      messages from JBoss console on app deployment


      14:43:41,309 INFO  [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=tidbDatasource' from JNDI name 'java:tidbDatasource'
      14:43:41,356 INFO  [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=esamDatasource' from JNDI name 'java:esamDatasource'
      14:43:48,121 WARN  [TransactionManagerService] XAExceptionFormatters are not supported by the JBossTS Transaction Service - this warning can safely be ignored
      14:43:48,215 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=esamDatasource' to JNDI name 'java:esamDatasource'
      14:43:48,278 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=tidbDatasource' to JNDI name 'java:tidbDatasource'
      14:43:48,293 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#esam
      14:43:48,293 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
           name: esam
           ...].......
      .....
      43:50,746 INFO  [SettingsFactory] Query cache: disabled
      14:43:50,746 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
      14:43:50,746 INFO  [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
      14:43:50,746 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
      14:43:50,746 INFO  [SettingsFactory] Cache region prefix: persistence.unit:unitName=#esam
      14:43:50,746 INFO  [SettingsFactory] Structured second-level cache entries: disabled
      14:43:50,746 INFO  [SettingsFactory] Echoing all SQL to stdout
      14:43:50,746 INFO  [SettingsFactory] Statistics: disabled
      14:43:50,746 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      14:43:50,746 INFO  [SettingsFactory] Default entity-mode: pojo
      14:43:50,746 INFO  [SettingsFactory] Named query checking : enabled
      14:43:52,746 INFO  [SessionFactoryImpl] building session factory
      14:43:56,028 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=#esam
      14:43:56,028 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      14:43:56,622 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=#esam
      14:43:56,622 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext



      Here's the exception that get's thrown when update is called.



      14:47:52,687 SEVERE [lifecycle] JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@62fea2]
      14:47:52,687 WARN  [ExceptionFilter] handling uncaught exception
      javax.servlet.ServletException: viewId:/GradeToLevelListMultiEdit.seam - View /GradeToLevelListMultiEdit.seam could not be restored.
      
      caused by: javax.faces.application.ViewExpiredException: viewId:/GradeToLevelListMultiEdit.seam - View /GradeToLevelListMultiEdit.seam could not be restored.
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           ... 41 more
      14:47:52,687 WARN  [ExceptionFilter] exception root cause
      javax.faces.application.ViewExpiredException: viewId:/GradeToLevelListMultiEdit.seam - View /GradeToLevelListMultiEdit.seam could not be restored.
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185)