1 2 Previous Next 25 Replies Latest reply on Oct 11, 2007 5:45 PM by b.reeve Go to original post
      • 15. Re: #{conversationList} appears to be empty

         

        "trickyvail" wrote:
        I agree that a short sentence describing this requirement added to the documentation at 6.7.3 would be helpful to people using the conversationList or switcher.


        JIRA issue raised:

        http://jira.jboss.com/jira/browse/JBSEAM-1999

        • 16. Re: #{conversationList} appears to be empty
          b.reeve

          I tried printing the conversationEntries

          ConversationEntries convEntries = ConversationEntries.instance();
          Collection<ConversationEntry> entryCollection = convEntries.getConversationEntries();
          if(!entryCollection.isEmpty()){
           System.out.println("--------------Conversation Entries Desc-----------------");
           Iterator<ConversationEntry> entryIter = entryCollection.iterator();
           while(entryIter.hasNext()){
           ConversationEntry entry = (ConversationEntry) entryIter.next();
           System.out.println("Description : " + entry.getDescription() + ((entry.isCurrent()? " [current]" : "[not current]")) +
           " -- " + ((entry.isDisplayable()? " Displayable" : " Not Displayable" )));
           }
          }

          and this is the result.
          --------------Conversation Entries Desc-----------------
          Description : View Item - Item1 [not current] -- Displayable
          Description : View Item - Item2 [not current] -- Displayable
          

          What I dont understand is why am I getting the java.lang.UnsupportedOperationException
          java.lang.UnsupportedOperationException
           at org.jboss.seam.Namespace.entrySet(Namespace.java:23)
           at java.util.AbstractMap.toString(Unknown Source)
           at java.lang.String.valueOf(Unknown Source)
           at java.lang.StringBuilder.append(Unknown Source)
           at com.sun.webui.jsf.faces.UIComponentELResolver.getValue(UIComponentELResolver.java:72)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.apache.el.parser.AstValue.getValue(AstValue.java:97)
           at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:69)
           at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1684)
           at org.jboss.seam.Component.getInstance(Component.java:1633)
           at org.jboss.seam.Component.getInstance(Component.java:1610)
           at org.jboss.seam.Component.getInstance(Component.java:1604)
           at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
           at org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:29)
           at org.apache.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:26)
           at org.apache.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:31)
           at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
           at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
           at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
           at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:256)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
           at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
           at java.lang.Thread.run(Unknown Source)

          I am sure that the conversationEntries are getting populated, but it is the #{conversationList} that is causing the exception.
          Please advice !

          • 17. Re: #{conversationList} appears to be empty

            Please post the page where you are attempting to display the conversationList.

            • 18. Re: #{conversationList} appears to be empty
              b.reeve

              This is the conversations.xhtml page

              <div xmlns="http://www.w3.org/1999/xhtml"
               xmlns:c="http://java.sun.com/jstl/core"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:s="http://jboss.com/products/seam/taglib">
              
              <div class="section">
               <h:form>
               <h:outputText value="#{empty conversationList}" />
               </h:form>
              </div>
              </div>
              


              And this is the page that includes the conversations.xhtml
              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:c="http://java.sun.com/jsp/jstl/core"
               xmlns:ui="http://java.sun.com/jsf/facelets">
               <head>
               <title><ui:insert name="pageTitle"></ui:insert></title>
               </head>
               <body>
               <ui:include src="/header.xhtml" />
               <div class="wrapper">
               <h4><ui:insert name="pageHeader">Page Not found</ui:insert></h4>
               <ui:insert name="pageBody">Page Not found</ui:insert>
               </div>
               <ui:include src="/conversations.xhtml" />
               <ui:include src="/copyright.xhtml" />
               </body>
               </html>
              

              So whenever i try hitting any page I am getting the UnsupportedOperationException, when I remove the #{conversationList} everything is fine. Am I missing something to get the conversationList component, because I am getting the conversationEntries correctly.

              • 19. Re: #{conversationList} appears to be empty
                b.reeve

                Could anyone please help me with this situation. Why am i getting this exception? conversationList being empty is understandable but this exception, i cannot figure out what is happening here.

                • 20. Re: #{conversationList} appears to be empty

                  It looks like you may have conflicting versions of jars (or at least expected versions). The method Namespace.entrySet no longer exists in Seam 2.0.0.CR1. What version of Seam are you using?

                  • 21. Re: #{conversationList} appears to be empty
                    b.reeve

                    I am using Seam 1.2.1 with Tomcat 6.0.10, JSF 1.2, Facelets 1.1.12.

                    • 22. Re: #{conversationList} appears to be empty
                      b.reeve

                      I am using Seam 1.2.1 with Tomcat 6.0.10, JSF 1.2, Facelets 1.1.12.
                      But then how #{conversationEntries} in conversations.xhtml doesn't throw this exception.

                      • 23. Re: #{conversationList} appears to be empty

                        Sorry, with Seam 1.2.1 the method is part of the API so I'm at a loss here. Maybe someone else could chime in with any insight.

                        • 24. Re: #{conversationList} appears to be empty
                          omilian

                          I'm having a few difficulties with long running conversations, so I've added the "conversationLogger" event listener above to help debug the problem. However, I'm finding that when my @Begin method is invoked the logConversationBegin() method is not called.

                          I've added some extra methods to the logger which observe other events, such as "org.jboss.seam.postCreate.xxx", where xxx is one of my components, e.g.

                          @Name("conversationLogger")
                          public class ConversationLogger implements Serializable {
                          
                           private Log log = Logging.getLog(ConversationLogger.class);
                          
                           @Observer("org.jboss.seam.beginConversation")
                           public void logConversationBegin() {
                           Conversation currentConversation = Conversation.instance();
                           log.info("Beginning conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
                           .getParentId());
                           }
                          
                           @Observer("org.jboss.seam.postCreate.businessProfileQuestionnaireController")
                           public void logPostCreateBegin() {
                           Conversation currentConversation = Conversation.instance();
                           System.out.println(">>>>>>>>>>>>>>POST CREATE>>>>>>>>>>>>>");
                           log.info("Beginning conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
                           .getParentId());
                           }
                          
                           @Observer("org.jboss.seam.endConversation")
                           public void logConversationEnd() {
                           Conversation currentConversation = Conversation.instance();
                           log.info("Ending conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
                           .getParentId());
                           }
                          }


                          I see these events being raised and the conversationLogger is called, so I'm comfortable the logger is working:

                          18:38:53,421 INFO [STDOUT] >>>>>>>>>>>>>>POST CREATE>>>>>>>>>>>>>
                          18:38:53,421 INFO [ConversationLogger] Beginning conversation: 2, Parent Id: null


                          It would appear then that the Manager methods which raise the 'org.jboss.seam.beginConversation' event are not being called, yet I can see that I have a long running conversation by the following 3 means:

                          1 - In my @Begin method I do:

                          Conversation currentConversation = Conversation.instance();
                          System.out.println("Conversation id " + currentConversation.getId());


                          This prints "Conversation id 2"

                          2 - In my pages I've included:

                          Current converstation is long running #{org.jboss.seam.core.conversation.longRunning}


                          This displays "Current converstation is long running true"

                          3 - I can see the conversation with id 2 listed on the seam debug page

                          These 3 facts lead me to believe I've got a conversation, yet they don't seem to raise the 'org.jboss.seam.beginConversation' event; what could be going on here? Any ideas?

                          • 25. Re: #{conversationList} appears to be empty
                            b.reeve

                            On debugging I found that, when #{conversationEntries} is called the key coming in to Namespace.getChild(String key) is "conversationEntries" but for #{conversationList} , the key is always "org" and this is throwing the UnSupportedOperationException. Can anyone please help me with this??? Any help would be really appreciated.
                            Thanks !

                            1 2 Previous Next