4 Replies Latest reply on Aug 31, 2010 6:36 AM by dlichtenberger

    Producing @ConversationConcurrentAccessTimeout

    dlichtenberger

      Platform: Weld 1.0.1 SP3, Glassfish 3.0.1, JSF 2.0.2


      The timeout for locking the current conversation appears to be 0, leading to an immediate error message when accidentally accessing a conversation concurrently (e.g. by double-clicking a command link):


      org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type @ConversationScoped
           at org.jboss.weld.conversation.ConversationImpl.checkConversationActive(ConversationImpl.java:79)
           at org.jboss.weld.conversation.ConversationImpl.isTransient(ConversationImpl.java:234)
           at org.jboss.weld.conversation.ConversationImpl.toString(ConversationImpl.java:199)
           at java.text.MessageFormat.subformat(MessageFormat.java:1246)
           at java.text.MessageFormat.format(MessageFormat.java:836)
           at java.text.Format.format(Format.java:140)
           at java.text.MessageFormat.format(MessageFormat.java:812)
           at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:89)
           at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:78)
           at org.slf4j.cal10n.LocLogger.warn(LocLogger.java:141)
           at org.jboss.weld.conversation.ConversationEntry.lock(ConversationEntry.java:134)
           at org.jboss.weld.conversation.AbstractConversationManager.beginOrRestoreConversation(AbstractConversationManager.java:114)
           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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
           at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
           at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
           at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
           at org.jboss.weld.conversation.ServletConversationManager_$$_javassist_142.beginOrRestoreConversation(ServletConversationManager_$$_javassist_142.java)
           at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:171)
           at org.jboss.weld.jsf.WeldPhaseListener.beforeRestoreView(WeldPhaseListener.java:118)
           at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:87)




      Looking at AbstractConversationManager.concurrentAccessTimeout (which is annotated with @ConversationConcurrentAccessTimeout), it seems that the injection is not working in my application. I found a producer in ServletConversationManager, but this does not seem to get called either. I tried producing a value with the following class, but the method is never called:




      @Singleton
      public class Producers implements Serializable {
          private static final long serialVersionUID = -6496565086399330801L;
      
          @Produces @ConversationConcurrentAccessTimeout
          public long getConversationConcurrentAccessTimeout() {
              return 10000;    // 10 secs
          }
      
      }



      Is this working for other people?


      Cheers,
      Daniel Lichtenberger