8 Replies Latest reply on Sep 8, 2004 3:46 AM by Adrian Brock

    YO! - mdb deployment trouble

    kedaar ghanekar Newbie

      Hi, Im having trouble deploying a simple mdb listening on a topic. Here are the relevant files - thanks in advance for help.

      EJB-JAR.xml
      -----------------
      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      <enterprise-beans>
      <message-driven>
      <ejb-name>LinkPublisherMDB</ejb-name>
      <ejb-class>com.crisys.sf.framework.link.LinkPublisherMDB</ejb-class>
      <message-selector></message-selector>
      <transaction-type>Container</transaction-type>
      <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Topic</destination-type>
      <subscription-durability>Durable</subscription-durability>
      </message-driven-destination>
      <resource-ref>
      <res-ref-name>jms/TCF</res-ref-name>
      <res-type>javax.jms.TopicConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </message-driven>
      </enterprise-beans>
      </ejb-jar>




      JBOSS.XML
      ---------------
      <?xml version="1.0" encoding="UTF-8"?>

      <enterprise-beans>
      <message-driven>
      <ejb-name>LinkPublisherMDB</ejb-name>
      <configuration-name>Standard Message Driven Bean</configuration-name>
      <destination-jndi-name>topic/COM.CRISYS.SF.DTO.CALL</destination-jndi-name>
      <mdb-user>john</mdb-user>
      <mdb-passwd>needle</mdb-passwd>
      <mdb-client-id>DurableSubscriberExample</mdb-client-id>
      <resource-ref>
      <res-ref-name>jms/TCF</res-ref-name>
      <jndi-name>ConnectionFactory</jndi-name>
      </resource-ref>
      </message-driven>
      </enterprise-beans>


        • 1. Re: YO! - mdb deployment trouble
          kedaar ghanekar Newbie

          Here is the stack trace and topic MBean

          NEWTOPIC-SERVICE.XML
          -----------------------------------


          <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager



          STACK TRACE
          -------------------
          11:44:56,609 INFO [MessageDrivenInstancePool] Started
          11:44:56,609 INFO [MessageDrivenContainer] Started
          11:44:56,609 INFO [EjbModule] Started
          11:44:56,609 INFO [EJBDeployer] Deployed: file:/opt/obox/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/SF_LinkPublisherMDB.jar
          11:44:56,654 WARN [JMSContainerInvoker] JMS provider failure detected:
          javax.jms.IllegalStateException: The connection has already a clientID
          at org.jboss.mq.Connection.setClientID(Connection.java:339)
          at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:466)
          at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:579)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
          at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:220)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
          at $Proxy11.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:392)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy29.start(Unknown Source)
          at org.jboss.ejb.EjbModule.startService(EjbModule.java:329)
          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:966)
          at $Proxy11.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:392)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy19.start(Unknown Source)
          at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:540)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
          at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy7.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)

          • 2. Re: YO! - mdb deployment trouble
            kedaar ghanekar Newbie

            Topic MBean

            NEWTOPIC-SERVICE.XML
            -----------------------------------


            <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager

            • 3. Re: YO! - mdb deployment trouble
              Adrian Brock Master

               


              <mdb-user>john</mdb-user>
              <mdb-passwd>needle</mdb-passwd>
              <mdb-client-id>DurableSubscriberExample</mdb-client-id>


              If you are using the default configuration (used by the jboss testsuite)
              "john" already has a preconfigured client id.
              So you cannot "change" the client id on the connection, so remove the mdb-client-id.

              You can reproduce this manually with:
              connectionFactory.createQueueConnection("john", "needle");
              connection.setClientID("DurableSubscriberExample"); // throws the exception
              


              whereas
              connectionFactory.createQueueConnection("guest", "guest");
              connection.setClientID("MyClientID"); // OK, guest has no preconfigured id
              




              • 4. Re: YO! - mdb deployment trouble
                kedaar ghanekar Newbie

                Thanks Adrian,

                Ive got it working if I hot deploy it.

                However, if I deploy it first and then start JBoss I get an exception saying "DefaultJMSProvider not bound". This must be because my res-ref tags are not correct? Can you tell me what to add to my ejb-jar and jboss.xml?

                • 5. Re: YO! - mdb deployment trouble
                  Adrian Brock Master

                  No, it is because your jms-ds.xml is not configured correctly.

                  • 6. Re: YO! - mdb deployment trouble
                    kedaar ghanekar Newbie

                    Hi Adrian,

                    In my jms-ds.xml, it looks like I am missing a "depends" in my DefaultJMSProvider mbean. Here is the xml , can you tell me what to add?
                    -----------

                     <!-- The JMS provider loader -->
                    
                     <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
                    
                     name="jboss.mq:service=JMSProviderLoader,name=JBossMQProvider">
                    
                     <attribute name="ProviderName">DefaultJMSProvider</attribute>
                    
                     <attribute name="ProviderAdapterClass">
                    
                     org.jboss.jms.jndi.JBossMQProvider
                    
                     </attribute>
                    
                     <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
                    
                     <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
                    
                     </mbean>
                    



                    • 7. Re: YO! - mdb deployment trouble
                      kedaar ghanekar Newbie

                      I seem to have some trouble posting - the xml tags sometimes get stripped out of my post... I added a "+" sign in front of the tags to confuse the filter. By the way, why is JBoss.org filtering out xml from my posts???

                      <!-- The JMS provider loader -->

                      <+mbean code="org.jboss.jms.jndi.JMSProviderLoader"

                      name="jboss.mq:service=JMSProviderLoader,name=JBossMQProvider">

                      <+attribute name="ProviderName">DefaultJMSProvider<+/attribute>

                      <+attribute name="ProviderAdapterClass">

                      org.jboss.jms.jndi.JBossMQProvider

                      <+/attribute>

                      <+attribute name="QueueFactoryRef">java:/XAConnectionFactory<+/attribute>

                      <+attribute name="TopicFactoryRef">java:/XAConnectionFactory<+/attribute>

                      <+/mbean>

                      • 8. Re: YO! - mdb deployment trouble
                        Adrian Brock Master

                        That configuration is not deployed (yet?) otherwise you wouldn't get this error message.