4 Replies Latest reply on Nov 1, 2016 1:15 PM by headhunterx

    Wildfly10.Final required services not installed JMS Queue

    headhunterx

      Hi all,

      I created a Dynamic Web Project in Eclipse with Wildfly 10 Final and JSF 2.2.9. I tried to send a message via Message Driven Bean. But if I try to start the web application on Wildfly I get the following errors:

      23:57:53,971 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "MyApplication.war")]) - failure description: {
          "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.module.MyApplication.MyApplication.env.jms.queue.WebSocketDrivenQueue"],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.MyApplication.MyApplication.env.\"com.example.QueueSenderSessionBean\".myQueue is missing [jboss.naming.context.java.module.MyApplication.MyApplication.env.jms.queue.WebSocketDrivenQueue]"]
      }
      23:57:54,270 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 37) WFLYSRV0010: Deployed "MyApplication.war" (runtime-name : "MyApplication.war")
      23:57:54,273 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
      WFLYCTL0184: New missing/unsatisfied dependencies: service jboss.naming.context.java.module.MyApplication.MyApplication.env.jms.queue.WebSocketDrivenQueue (missing) dependents: [service jboss.naming.context.java.module.MyApplication.MyApplication.env."com.example.QueueSenderSessionBean".myQueue]
      
      

       

       

      This is my Message Driven Bean:

      @MessageDriven(
        activationConfig = { @ActivationConfigProperty(
        propertyName = "destination", propertyValue = "jms/queue/WebSocketDrivenQueue"), @ActivationConfigProperty(
        propertyName = "destinationType", propertyValue = "javax.jms.Queue")
         }, 
        mappedName = "jms/queue/WebSocketDrivenQueue")
         @Named
         public class WebSocketDriven implements MessageListener {
         @Inject
         @WSJMSMessage
         Event<Message> jmsEvent; 
      
         public WebSocketDriven() {
         }
      
         public void onMessage(Message message) {
        jmsEvent.fire(message);
        }
      
      }
      

       

      The QSenderSessionBean (I tested different scopes like Stateless, SessionScoped, etc., but every time with the same result):

      @Stateless
      public class QueueSenderSessionBean {
         @Resource(mappedName = "jms/queue/WebSocketDrivenQueue")
         private Queue myQueue;
         @Inject
         private JMSContext jmsContext; 
      
         public void sendMyText(String message){
        jmsContext.createProducer().send(myQueue, message);
        }
      
      }
      

       

      And the class which tries to send the message:

      public class MyTestApplication{
      
         private QueueSenderSessionBean senderBean;
      
         @Inject
         public WebSocketClient(QueueSenderSessionBean senderBean){
           this.senderBean = senderBean;
         }
      
         public void sendTheMessage(){
           this.senderBean.sendMyText("Hello");
         }
      
      }
      

       

      I started the WildFly server with the standalone-full.xml for JMS-Support and inserted the following line:

      <jms-queue name="WebSocketDrivenQueue" entries="java:/jms/queue/WebSocketDrivenQueue />
      

       

      Can anybody help me? Is there a config error or something similar? Thanks.

      Best regards.