7 Replies Latest reply on May 17, 2002 10:06 AM by giorgio42

    Troubles deploying the MDB subscribed to the durable topic

    petr

      I would like to subscribe my MessageDrivenBean to a durable topic but I am getting the following Exception:
      15:43:55,097 ERROR [JMSContainerInvoker] Reconnect failed: JMS provider failure detected:
      org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: null
      at org.jboss.mq.Connection.addConsumer(Connection.java:974)
      at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:73)
      at org.jboss.mq.SpyConnection.createDurableConnectionConsumer(SpyConnection.java:102)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:548)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1039)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:420)
      linked exception is:
      java.lang.NullPointerException
      at org.jboss.mq.DurableSubscriptionID.hashCode(DurableSubscriptionID.java:76)
      at java.util.HashMap.hash(HashMap.java:250)
      at java.util.HashMap.get(HashMap.java:301)
      at org.jboss.mq.server.JMSTopic.addSubscriber(JMSTopic.java:74)
      at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:144)
      at org.jboss.mq.server.JMSServer.subscribe(JMSServer.java:653)
      at org.jboss.mq.server.JMSServerInvokerSupport.subscribe(JMSServerInvokerSupport.java:288)
      at org.jboss.mq.security.ServerSecurityInvoker.subscribe(ServerSecurityInvoker.java:143)
      at org.jboss.mq.il.jvm.JVMServerIL.subscribe(JVMServerIL.java:314)
      at org.jboss.mq.Connection.addConsumer(Connection.java:962)
      at org.jboss.mq.SpyConnectionConsumer.(SpyConnectionConsumer.java:73)
      at org.jboss.mq.SpyConnection.createDurableConnectionConsumer(SpyConnection.java:102)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:548)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1039)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:420)

      The jboss.xml looks like this:

      jboss>
      <enterprise-beans>
      <message-driven>
      <ejb-name>MessageDispatcherMDB</ejb-name>
      <destination-jndi-name>topic/TrackerConfigurationTopic</destination-jndi-name>
      <mdb-user>client</mdb-user>
      <mdb-passwd>client</mdb-passwd>
      <mdb-subscriber-id>MessageDispatcherMDB</mdb-subscriber-id>
      </message-driven>
      </enterprise-beans>


      and the jbossmq-state.xml:


      client
      client
      MessageDispatcherMDB

      MessageDispatcherMDB
      topic/TrackerConfigurationTopic



      If the ejb-jar.xml for the Message bean is changed from Durable to NonDurable then everything works perfectly.

      Please, could anyone give me a hand. Petr

        • 1. Oracle and case preserved table names
          giorgio42

          If I create my Oracle table names using the case-preserving quote:
          CREATE TABLE "CustomerOrders"
          then the table name is not upper-cased by Oracle. I must therefore use the quotes on all SQL statements I issue.
          When running on MySQL (I don't have Oracle yet), I noticed that the queries jboss constructs for my CMP entity beans are not quoted.
          So when I port to Oracle, my CMP beans will fail - right?
          If so, is there a way to tell JBoss to quote table names?
          If there is, will JBoss use the quote character appropriate to the DBMS?

          Thanks,
          Bob

          • 2. Re: Troubles deploying the MDB subscribed to the durable top
            giorgio42


            Hi Petr,

            you're not alone!
            I keep getting this message, too.

            Somehow I got it working on my office box.
            I post again when I get there, probably tomorrow.

            Georg

            • 3. Re: Troubles deploying the MDB subscribed to the durable top
              giorgio42


              Ehmm... just noticed that I got it working by making it
              non-durable, just like you... :-(

              Georg

              • 4. Re: Troubles deploying the MDB subscribed to the durable top
                petr

                Hi Georg, have you found out anything helpful? Me not yet, I'll keep trying

                • 5. Re: Troubles deploying the MDB subscribed to the durable top
                  valenta_jakub

                  Hi,
                  I don't know what's the problem, but here goes my setting for durable MDB which works just fine.

                  ejb-jar.xml
                  <?xml version="1.0"?>
                  <!DOCTYPE ejb-jar>
                  <ejb-jar>
                  <enterprise-beans>
                  <message-driven>
                  <ejb-name>InboundMDB</ejb-name>

                  <ejb-class>net.deio.sysint.server.InboundMDB</ejb-class>

                  <message-selector>Receiver='POC'
                  </message-selector>

                  <transaction-type>Container</transaction-type>

                  <message-driven-destination>
                  <destination-type>javax.jms.Topic</destination-type>

                  <subscription-durability>Durable</subscription-durability>
                  </message-driven-destination>
                  </message-driven>
                  </enterprise-beans>

                  <assembly-descriptor>
                  <container-transaction>

                  <ejb-name>InboundMDB</ejb-name>

                  <method-name>*</method-name>


                  <trans-attribute>Required</trans-attribute>
                  </container-transaction>
                  </assembly-descriptor>
                  </ejb-jar>

                  jboss.xml
                  <?xml version="1.0" encoding="Cp1252"?>

                  <enterprise-beans>
                  <message-driven>
                  <ejb-name>InboundMDB</ejb-name>

                  <configuration-name>Standard Message Driven Bean</configuration-name>

                  <destination-jndi-name>topic/OUTBOUND_TOPIC</destination-jndi-name>

                  <mdb-user>InboundMDB</mdb-user>

                  <mdb-passwd>InboundMDB</mdb-passwd>

                  <mdb-client-id>InboundMDB</mdb-client-id>
                  </message-driven>
                  </enterprise-beans>


                  jboss.jcml
                  ...

                  ...

                  jbossmq-state.xml
                  <?xml version="1.0" encoding="UTF-8"?>


                  InboundMDB
                  InboundMDB
                  InboundMDB

                  InboundMDB
                  OUTBOUND_TOPIC


                  ...

                  hope it helps,

                  Jakub

                  • 6. Re: Troubles deploying the MDB subscribed to the durable top
                    petr

                    Hi Jakub, thanks for sharing the example. I have done exactly what it says and I am getting the following exception: 19:07:01,136 WARN [JMSContainerInvoker] JMS provider failure detected:
                    javax.jms.IllegalStateException: The connection has already a clientID
                    at org.jboss.mq.Connection.setClientID(Connection.java:288)
                    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:516)
                    at org.jboss.ejb.plugins.jms.JMSContainerInvoker.create(JMSContainerInvoker.java:415)
                    at org.jboss.ejb.MessageDrivenContainer.create(MessageDrivenContainer.java:168)
                    at org.jboss.ejb.Container.invoke(Container.java:790)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                    at $Proxy0.create(Unknown Source)
                    at org.jboss.system.ServiceController.create(ServiceController.java:271)
                    at sun.reflect.GeneratedMethodAccessor38.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:491)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy89.create(Unknown Source)
                    at org.jboss.ejb.EjbModule.createService(EjbModule.java:392)
                    at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
                    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:491)
                    at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                    at $Proxy0.create(Unknown Source)
                    at org.jboss.system.ServiceController.create(ServiceController.java:271)
                    at org.jboss.system.ServiceController.create(ServiceController.java:211)
                    at sun.reflect.GeneratedMethodAccessor5.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:491)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy5.create(Unknown Source)
                    at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:376)
                    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:651)
                    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:645)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:526)
                    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:490)
                    at sun.reflect.GeneratedMethodAccessor10.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:491)
                    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                    at $Proxy4.deploy(Unknown Source)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
                    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:202)
                    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDe

                    Have you got any idea where is the problem? Thanks. Petr

                    • 7. Re: Troubles deploying the MDB subscribed to the durable top
                      giorgio42

                      First of all I should say that I'm using the current CVS head of JBoss3.1.0alpha on Win2K/SunJDK 1.4.


                      I've been able to spend several hours more on this problem. I used trace-level logging for org.jboss.mq to
                      get more debugging output.

                      The core problem is, that in the
                      DurableSubscriptionID instance, that is used while
                      subscribing to the durable topic, the subscriptionName
                      member is null.

                      The container keeps a list of durable queues. During the
                      subscription process it tries to get the queue that is
                      associated with the durable topic by looking it up in a
                      HashMap. This lookup makes the durable subscription
                      calculate its hash code, which is computed as
                      Integer.MIN_VALUE + clientID.hashCode() +
                      subscriptionName.hashCode().

                      Therefore, when the subscriptionName is null, we get the
                      NPE that we keep seeing.

                      I added some code to emit additional trace messages to
                      make this show up clearly (if I knew the JBoss code more
                      I could have seen it from the line just above the
                      highlighted one below):

                      2002-05-26 16:16:28,125 DEBUG [org.jboss.jms.asf.StdServerSessionPool] Server Session pool set up
                      2002-05-26 16:16:28,140 TRACE [org.jboss.mq.Connection] Connection: addConsumer(dest=TOPIC.myTopic.MyTopic.null)
                      2002-05-26 16:16:28,140 TRACE [org.jboss.mq.Connection] DurableSubscriptionID: clientID=MyTopic, subscription: null
                      2002-05-26 16:16:28,140 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : subscribe
                      2002-05-26 16:16:28,140 TRACE [org.jboss.mq.security.ServerSecurityInterceptor] Checking subscribe authorize on SpyDistributedConnection:MyTopic/1aa74b59a59225b74cea68940d0c08a6 sub=org.jboss.mq.Subscription {-2147483648,TOPIC.myTopic.MyTopic.null,null,Destroy,Local,}
                      2002-05-26 16:16:28,140 TRACE [org.jboss.mq.security.SecurityManager] Checking authorize on subjectInfo: SubjectInfo {subject=Betreff:Principal: myPrincipal
                      Principal: Roles;principal=myPrincipal;roles=Roles for rolePrincipals [mySubscriber, myPublisher, guest]

                      Now the question is: why is the subscriptionName null,
                      although, according to the trace log, everything seems to
                      be fine up to the point where the MDB actually tries to
                      subscribe to the topic.

                      Currently I do not have any idea yet.

                      Have you been able to solve your problem in the meantime?

                      I keep trying too. TINA.

                      Georg