5 Replies Latest reply on May 7, 2007 4:58 AM by Ypatios Asmanidis

    Exception getting value of property

    Ypatios Asmanidis Newbie

      Ok here is my stateful bean

      @Stateful
      @Name("uaiContext")
      @Scope(ScopeType.SESSION)
      public class UaiContext implements uaiContx,Serializable {
      
       /**
       *
       */
       private static final long serialVersionUID = -5059323890154970180L;
      
       @Logger
       private Log log;
      
       private boolean loggedIn;
      
       private boolean adminLogged;
       private boolean userLogged;
       private boolean agentLogged;
      
       private String email;
      
       @In
       Context sessionContext;
      
       private boolean authorized=false;
      
      
       public boolean isAuthorized() {
      
       User user=(User)Contexts.getSessionContext().get("currentUser");
      
       if (user instanceof AuthorUser) {
       AuthorUser temp=(AuthorUser)user;
       authorized=temp.isAuthorized();
       }
      
       if (authorized)
       return authorized;
       else return false;
       }
      
       public void setAuthorized(boolean authorized) {
       this.authorized = authorized;
       }
      
       /*
       * (non-Javadoc)
       *
       * @see uai.blogic.uaiContx#isLogged()
       */
      
      
       public String authorizeUser() {
      
       return "authorize";
       }
      
       @Destroy
       @Remove
       public void destroy() {
       log.info("Destroying uaiContext");
      
      
      
       }
      
       public boolean isLoggedIn() {
       try{
       log.info("Checking currrentUser");
       return (sessionContext.get("currentUser")!=null);
       }catch(Exception e) { return false; }
       }
      
       public void setLoggedIn(boolean loggedIn) {
       this.loggedIn = loggedIn;
       }
      
       public boolean isAdminLogged() {
      
       User user=(User)sessionContext.get("currentUser");
       //User user=(User)Contexts.getSessionContext().get("currentUser");
       log.info("Admin Logged : "+(user instanceof AdminUser));
       return (user instanceof AdminUser);
       }
      
       public void setAdminLogged(boolean adminLogged) {
       this.adminLogged = adminLogged;
       }
      
       public boolean isAgentLogged() {
      
       User user=(User)sessionContext.get("currentUser");
       //User user=(User)Contexts.getSessionContext().get("currentUser");
       log.info("Is Agent Logged : "+(user instanceof AgentUser));
       return (user instanceof AgentUser);
      
       }
      
       public void setAgentLogged(boolean agentLogged) {
       this.agentLogged = agentLogged;
       }
      
       public boolean isUserLogged() {
      
       User user=(User)sessionContext.get("currentUser");
       //User user=(User)Contexts.getSessionContext().get("currentUser");
       log.info("Is Author Logged : "+(user instanceof AuthorUser));
       return (user instanceof AuthorUser);
      
       }
      
       public void setUserLogged(boolean userLogged) {
       this.userLogged = userLogged;
       }
      
       public String getEmail() {
       try{
       User user=(User)Contexts.getSessionContext().get("currentUser");
       if (user!=null) return user.getEmail();
      
       }catch(Exception e) { }
       return "";
      
       }
      
       public void setEmail(String email) {
       this.email = email;
       }
      
      }
      
      
      


      my xhtml page code

      <ui:define name="leftmenu">
       <h1>Menu</h1>
      
       <ul class="sidemenu">
       <c:if test="#{!(uaiContext.loggedIn)}">
       <ui:include src="extras/defaultMenu.xhtml"/>
      
       </c:if>
      
       <c:if test="#{uaiContext.userLogged}">
      
       <ui:include src="extras/authorMenu.xhtml"/>
       </c:if>
       <c:if test="#{uaiContext.adminLogged}">
       <ui:include src="extras/adminMenu.xhtml"/>
       </c:if>
       <c:if test="#{uaiContext.agentLogged}">
       <ui:include src="extras/agentMenu.xhtml"/>
       </c:if>
      
       </ul>
      
       </ui:define>
      
      


      my problem is that if I stay idle for sometime when I try to refresh or go to another page I got this exception


      07:31:59,072 ERROR [STDERR] 7 ??? 2007 7:31:59 ?? com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/verify.xhtml]
      com.sun.facelets.tag.TagAttributeException: /extras/template_uai.xhtml @46,44 test="#{uaiContext.loggedIn}" /extras/template_uai.xhtml @46,44 test="#{uaiContext.loggedIn}": Exception getting value of property loggedIn of base of type : $Proxy193
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
       at com.sun.facelets.tag.TagAttribute.getBoolean(TagAttribute.java:79)
       at com.sun.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:49)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
       at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:490)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:533)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at uai.utilities.CharsetFilter.doFilter(CharsetFilter.java:23)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.el.ELException: /extras/template_uai.xhtml @46,44 test="#{uaiContext.loggedIn}": Exception getting value of property loggedIn of base of type : $Proxy193
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
       at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233)
       ... 45 more
      Caused by: javax.faces.el.EvaluationException: Bean: $Proxy193, property: loggedIn
       at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
       at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       ... 46 more
      Caused by: java.lang.reflect.InvocationTargetException
       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.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
       ... 51 more
      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of org.jboss.seam.contexts.WebSessionContext - org.jboss.seam.contexts.WebSessionContext
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:152)
       at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(StatefulContainer.java:376)
       at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBeanContext.java:183)
       at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:312)
       at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:265)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
       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 $Proxy193.isLoggedIn(Unknown Source)
       ... 56 more
      Caused by: java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of org.jboss.seam.contexts.WebSessionContext - org.jboss.seam.contexts.WebSessionContext
       at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:367)
       at org.jboss.ejb3.stateful.StatefulBeanContext.getInterceptorInstances(StatefulBeanContext.java:333)
       at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.getLifecycleInvocationContext(LifecycleInvocationContextImpl.java:65)
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postActivate(LifecycleInterceptorHandler.java:143)
       ... 72 more
      Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of org.jboss.seam.conte
      07:31:59,091 ERROR [STDERR] xts.WebSessionContext - org.jboss.seam.contexts.WebSessionContext
       at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
       at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
       at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
       at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
       at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
       at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
       at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
       at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342)
       at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
       at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:342)
       ... 75 more
      Caused by: java.lang.InstantiationException: org.jboss.seam.contexts.WebSessionContext
       at java.lang.Class.newInstance0(Class.java:335)
       at java.lang.Class.newInstance(Class.java:303)
       at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334)
       ... 94 more
      
      
      
      


      any ideas?