5 Replies Latest reply on Sep 18, 2012 7:19 AM by carlos hilner f costa

    ServiceNotFoundException JMS

    nimo stephan Master

      I have put the jms-module in standalone.xml: (I just copied the jms-parts from standalone-full.xml)

       

      <extension module="org.jboss.as.messaging"/>

      ..

      <subsystem xmlns="urn:jboss:domain:messaging:1.1">
                  <hornetq-server>
                      <persistence-enabled>true</persistence-enabled>
                      <journal-file-size>102400</journal-file-size>
                      <journal-min-files>2</journal-min-files>
                      <connectors>
                          <netty-connector name="netty" socket-binding="messaging"/>
                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                          </netty-connector>
                          <in-vm-connector name="in-vm" server-id="0"/>
                      </connectors>
                      <acceptors>
                          <netty-acceptor name="netty" socket-binding="messaging"/>
                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                              <param key="direct-deliver" value="false"/>
                          </netty-acceptor>
                          <in-vm-acceptor name="in-vm" server-id="0"/>
                      </acceptors>
                      <security-settings>
                          <security-setting match="#">
                              <permission type="send" roles="guest"/>
                              <permission type="consume" roles="guest"/>
                              <permission type="createNonDurableQueue" roles="guest"/>
                              <permission type="deleteNonDurableQueue" roles="guest"/>
                          </security-setting>
                      </security-settings>
                      <address-settings>
                          <!--default for catch all-->
                          <address-setting match="#">
                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                              <redelivery-delay>0</redelivery-delay>
                              <max-size-bytes>10485760</max-size-bytes>
                              <address-full-policy>BLOCK</address-full-policy>
                              <message-counter-history-day-limit>10</message-counter-history-day-limit>
                          </address-setting>
                      </address-settings>
                      <jms-connection-factories>
                          <connection-factory name="InVmConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="in-vm"/>
                              </connectors>
                              <entries>
                                  <entry name="java:/ConnectionFactory"/>
                              </entries>
                          </connection-factory>
                          <connection-factory name="RemoteConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="netty"/>
                              </connectors>
                              <entries>
                                  <entry name="RemoteConnectionFactory"/>
                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                              </entries>
                          </connection-factory>
                          <pooled-connection-factory name="hornetq-ra">
                              <transaction mode="xa"/>
                              <connectors>
                                  <connector-ref connector-name="in-vm"/>
                              </connectors>
                              <entries>
                                  <entry name="java:/JmsXA"/>
                              </entries>
                          </pooled-connection-factory>
                      </jms-connection-factories>
                      <jms-destinations>
                          <jms-queue name="testQueue">
                              <entry name="queue/test"/>
                              <entry name="java:jboss/exported/jms/queue/test"/>
                          </jms-queue>
                          <jms-topic name="testTopic">
                              <entry name="topic/test"/>
                              <entry name="java:jboss/exported/jms/topic/test"/>
                          </jms-topic>
                      </jms-destinations>
                  </hornetq-server>
              </subsystem>

      ..

       

      <socket-binding name="messaging" port="5445"/>
      <socket-binding name="messaging-throughput" port="5455"/>

       

      Starting the server works, hornetq is also registered and started successfully.

       

      However, when deploying the following common MDB, then I get a error and the server is not starting:

       

      @MessageDriven(activationConfig = {
              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
              @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/test")
      })
      public class SampleMDBBean implements MessageListener {

          public SampleMDBBean(){}
         
          /**
           * @see MessageListener#onMessage(Message)
           */
          public void onMessage(Message message) {
              try {
                  TextMessage msg = (TextMessage) message;
                  String txt = msg.getText();
                  System.out.println("TextMessage received: " + txt.toString());
              } catch (JMSException e) {
                  e.printStackTrace();
              }
          }
      }

       

      I get this stacktrace:

       

      17:42:15,583 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."testapp.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."testapp.war".PARSE: Failed to process phase PARSE of deployment "testapp.war"
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_01]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_01]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]
      Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-resource-adapter-name-service not found
          at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:447) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.getDefaultResourceAdapterName(MessageDrivenComponentDescriptionFactory.java:273)
          at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processMessageBeans(MessageDrivenComponentDescriptionFactory.java:153)
          at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processAnnotations(MessageDrivenComponentDescriptionFactory.java:81)
          at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:58)
          at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
          ... 5 more

       

      Though,"queue/test" is already registered in standalone.xml, I get a error that the service-name is not found.

       

      What is wrong with my settings?