5 Replies Latest reply on Aug 9, 2008 7:43 PM by Pete Muir

    FacesMessage does not not display my message

    Fleury Ludovic Newbie

      Hey,


      I'm calling an asynchronous method and I would like to notify the client that the method has ended by displaying a message on the
      screen. The problem is that the message is not displayed.
      I'm using JMS with a message-driven bean and a stateful bean :



      @MessageDriven(activationConfig = {
                @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
                @ActivationConfigProperty(propertyName="destination", propertyValue="queue/pQueue")})
      
      @Name("ProcessMessageListener")
      public class ProcessMessageListener implements MessageListener {
      
           public void onMessage(Message m) {
                try {
                     FacesMessages.instance().add("message id = " + m.getJMSMessageID()); //THIS MESSAGE IS NOT DISPLAYED 
                     
                } catch (JMSException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                }
           }
      }
      
      
      @Stateful
      @Name("resourceManager")
      @Scope(ScopeType.SESSION)
      
      
      public class Resource implements IResource, Serializable {
               @In(create=true)
            private transient QueueSender queueSender; 
           
            @In(create=true)
            private transient QueueSession queueSession;
           
           public void delete() {
                 try
                  {
                     queueSender.send( queueSession.createTextMessage("Resource has been deleted"));
                  }
                  catch (Exception ex)
                  {
                  ex.printStackTrace();
                     throw new RuntimeException(ex);
                  } 
          }
      }
      
      public interface IResource {
      
           @Asynchronous
           void delete();
      
           void destroy();
      }




      Thank you for your help.


      LF


      Using seam-1.2.1-GA