Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0_b89_RC5
    • Fix Version/s: None
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      mac osx

      Description

      Hi,

      Got some CDI issues on the latest GlassFish version

      First in JSF2.2 the flowDefinition of flows does not work , I needed to use the faces-config.xml and that works perfectly

      my example
      @Named("flow1")
      public class Flow1 implements Serializable {

      private static final long serialVersionUID = -1L;

      @Produces @FlowDefinition
      public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder)

      { System.out.println("flowdef"); String flowId = "flow1"; flowBuilder.id("", flowId); flowBuilder.viewNode(flowId, "/flow1/" + flowId + ".xhtml").markAsStartNode(); return flowBuilder.getFlow(); }

      }

      Also in the websockets and do an inject of session bean and does not do anything , also listen to an CDI event inside does not work

      @ServerEndpoint("/mywebsocket")
      public class MyWebSocket implements Serializable {

      @Inject
      JmsSessionBean jmsBean;

      public void onJMSMessage(@Observes @CDIJmsEvent Message msg) {
      System.out.println("Got JMS Message at WebSocket!");
      try {
      for (Session s : sessions)

      { s.getBasicRemote().sendText("message from JMS: " + msg.getBody(String.class)); }

      } catch (IOException | JMSException ex)

      { ex.printStackTrace(); }

      }

      Inside a managed bean Inject and the CDI events works perfectly

        Activity

        Hide
        Darious3 added a comment -

        Flow example with formatting:

        @Named("flow1")
        public class Flow1 implements Serializable {
        
            private static final long serialVersionUID = -1L;
        
            @Produces @FlowDefinition
            public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder) { 
               
                String flowId = "flow1"; 
                flowBuilder.id("", flowId); 
                flowBuilder.viewNode(flowId, "/flow1/" + flowId + ".xhtml").markAsStartNode(); 
        
                return flowBuilder.getFlow();
            }
        }
        

        WebSocket with formatting

        @ServerEndpoint("/mywebsocket")
        public class MyWebSocket implements Serializable {
        
            @Inject
            JmsSessionBean jmsBean;
        
            public void onJMSMessage(@Observes @CDIJmsEvent Message msg) {
                try {
                    for (Session session : sessions) {
                        session.getBasicRemote().sendText("message from JMS: " + msg.getBody(String.class));
                    }
                } catch (IOException | JMSException ex) {
                    ex.printStackTrace();
                }
            }
        }
        
        Show
        Darious3 added a comment - Flow example with formatting: @Named( "flow1" ) public class Flow1 implements Serializable { private static final long serialVersionUID = -1L; @Produces @FlowDefinition public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder) { String flowId = "flow1" ; flowBuilder.id("", flowId); flowBuilder.viewNode(flowId, "/flow1/" + flowId + ".xhtml" ).markAsStartNode(); return flowBuilder.getFlow(); } } WebSocket with formatting @ServerEndpoint( "/mywebsocket" ) public class MyWebSocket implements Serializable { @Inject JmsSessionBean jmsBean; public void onJMSMessage(@Observes @CDIJmsEvent Message msg) { try { for (Session session : sessions) { session.getBasicRemote().sendText( "message from JMS: " + msg.getBody( String .class)); } } catch (IOException | JMSException ex) { ex.printStackTrace(); } } }
        Hide
        jjsnyder83 added a comment -

        I believe the WebSocket issue is a duplicte of : https://java.net/jira/browse/GLASSFISH-20371.

        For the JSF issue can you provide more information on what the expected results are?

        Show
        jjsnyder83 added a comment - I believe the WebSocket issue is a duplicte of : https://java.net/jira/browse/GLASSFISH-20371 . For the JSF issue can you provide more information on what the expected results are?
        Hide
        biemond added a comment -

        Hi,

        here is my netbeans projects on glassfish 4 https://github.com/biemond/JavaEE7

        I defined some JSF 2.2 flows in
        https://github.com/biemond/JavaEE7/tree/master/WebApp7EE/WebApp7EE-war/web/flow1

        When I add this flow definition in the faces-config.xml it works fine
        https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/web/WEB-INF/faces-config.xml

        but when I try to do the same in this class with the help of CDI
        @Produces @FlowDefinition
        public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder)
        in java class
        https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/src/java/nl/amis/web/flow/Flow1.java

        It does not do anything ( don't see any CDI error ) and the page /flow1.xhtml can not be found.

        Thanks

        Show
        biemond added a comment - Hi, here is my netbeans projects on glassfish 4 https://github.com/biemond/JavaEE7 I defined some JSF 2.2 flows in https://github.com/biemond/JavaEE7/tree/master/WebApp7EE/WebApp7EE-war/web/flow1 When I add this flow definition in the faces-config.xml it works fine https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/web/WEB-INF/faces-config.xml but when I try to do the same in this class with the help of CDI @Produces @FlowDefinition public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder) in java class https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/src/java/nl/amis/web/flow/Flow1.java It does not do anything ( don't see any CDI error ) and the page /flow1.xhtml can not be found. Thanks

          People

          • Assignee:
            phil.zampino
            Reporter:
            biemond
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: