8 Replies Latest reply on Jun 12, 2007 11:11 PM by SUNDARRAJAN SUYAMBOO

    create durable topic

    teo doro Newbie

      Hi,
      I'm trying to create a durable topic with jboss-4.0.5.GA

      my configuration's files are:


      oracle-jdbc2-service.xml configured to my OracleDS
      hsqldb-jdbc-state-service.xml configured to my OracleDS


      ----------------------------------------------
      jbossmq-destinations-service.xml:


      <!-- The following is my topic example -->


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











      ----------------------------------------------


      When I start jboss-4.0.5.GA instance (./run.sh) I see
      ....
      .....
      ....
      00:00:01,325 INFO [myTopic] Bound to JNDI name: topic/myTopic
      ....
      ....
      ..... Started in 1m:....


      and inside my Oracle schema there are the following tables:

      JMS_MESSAGES
      JMS_ROLES
      JMS_SUBSCRIPTIONS
      JMS_TRANSACTIONS
      JMS_USERS



      TABLE JMS_USERS:

      USERID PASSWD CLIENTID
      ----------------------------------------------------------
      dynsub dynsub
      nobody nobody
      john needle DurableSubscriberExample
      j2ee j2ee
      guest guest


      TABLE JMS_ROLES:

      ROLEID USERID
      ---------------------------- --------------------------------
      durpublisher dynsub
      publisher dynsub
      guest guest
      j2ee guest
      john guest
      durpublisher john
      publisher john
      subscriber john
      noacc nobody


      TABLE JMS_SUBSCRIPTIONS:

      CLIENTID SUBNAME TOPIC SELECTOR

      0 rows selected


      After this, I have deployed my MBD:

      <?xml version = '1.0' encoding = 'ISO-8859-1'?>
      <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee">
      <enterprise-beans>
      <message-driven>
      Message Driven Bean
      <display-name>MessageDrivenEJB</display-name>
      <ejb-name>MessageDrivenEJB</ejb-name>
      <ejb-class>it.java.lab.mdb.MessageDrivenEJBBean</ejb-class>
      <messaging-type>javax.jms.MessageListener</messaging-type>
      <transaction-type>Container</transaction-type>
      <message-destination-type>javax.jms.Topic</message-destination-type>
      <activation-config>
      <activation-config-property>
      <activation-config-property-name>destinationType</activation-config-property-name>
      <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
      <activation-config-property-name>subscriptionDurability</activation-config-property-name>
      <activation-config-property-value>Durable</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
      <activation-config-property-name>destination</activation-config-property-name>
      <activation-config-property-value>topic/myTopic</activation-config-property-value>
      </activation-config-property>
      </activation-config>
      </message-driven>
      </enterprise-beans>
      <assembly-descriptor/>
      </ejb-jar>



      I always receive the following exception:

      09:03:51,543 WARN [JMSContainerInvoker] JMS provider failure detected for MessageDrivenEJB
      org.jboss.deployment.DeploymentException: Error during topic setup; - nested throwable: (javax.jms.JMSException: Null or empty subscription)
      at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:720)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:839)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:194)
      at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy76.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:429)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy25.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy26.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: javax.jms.JMSException: Null or empty subscription
      at org.jboss.mq.SpyConnection.createDurableConnectionConsumer(SpyConnection.java:193)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:702)
      ... 113 more



      I can't figured out this problem, please help me.
      I don't find any example how to configure step by step a topic durable subcription with ejb 2.1.
      What's I missing??
      Where and how I can specified user and password and subscitpion-id????

      With ejb 2.0 I have readed about subscription-id tag inside jboss.xml but this not resolve my problem.

      thanks in advance.
      teo..










        • 1. Re: create durable topic
          teo doro Newbie


          I rewrite the jbossmq-destinations-service.xml file correctly:



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







          • 2. Re: create durable topic
            teo doro Newbie




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







            • 3. Re: create durable topic
              teo doro Newbie

              I'm tyring to use entity reference to display jbossmq-destinations-service's
              SecurityConf attribute.

              &lt;attribute name="SecurityConf"&gt;
              &lt;security
              &lt;role name="guest" read="true" write="true"/&lt;
              &lt;role name="publisher" read="true" write="true" create="false"/&lt;
              &lt;role name="durpublisher" read="true" write="true" create="true"/&lt;
              &lt;/security&gt;

              • 4. Re: create durable topic
                Adrian Brock Master

                IIRC this was the very first FAQ created for JBossMQ.
                So if you can't find the answer in the FAQ I'd be very surprised. :-)

                • 5. Re: create durable topic
                  Adrian Brock Master

                  I've updated that WIKI page to make it explict what you need to configure for MDBs
                  by providing links to where it is explained.
                  http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatIsTheCorrectWayToMakeADurableSubscription

                  • 6. Re: create durable topic
                    teo doro Newbie

                    Thanks Adrian for your reply, I followed it but now I get this error:


                    ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                    --- Packages waiting for a deployer ---
                    org.jboss.deployment.DeploymentInfo@36c24c5d { url=file:/......../opt/jboss-4.0.5.GA/server/default/deploy/jms/conf/jbossmq-state.xml }
                    deployer: null
                    status: null
                    state: INIT_WAITING_DEPLOYER
                    watch: file:/....../opt/jboss-4.0.5.GA/server/default/deploy/jms/conf/jbossmq-state.xml
                    altDD: null
                    lastDeployed: 1181151387033
                    lastModified: 1181151387000
                    mbeans:

                    --- Incompletely deployed packages ---
                    org.jboss.deployment.DeploymentInfo@36c24c5d { url=file:/......./opt/jboss-4.0.5.GA/server/default/deploy/jms/conf/jbossmq-state.xml }
                    deployer: null
                    status: null
                    state: INIT_WAITING_DEPLOYER
                    watch: file:/........./opt/jboss-4.0.5.GA/server/default/deploy/jms/conf/jbossmq-state.xml
                    altDD: null
                    lastDeployed: 1181151387033
                    lastModified: 1181151387000
                    mbeans:


                    What means?

                    • 7. Re: create durable topic
                      Adrian Brock Master

                      It must end in -service.xml, e.g. jbossmq-state-service.xml

                      • 8. Re: create durable topic
                        SUNDARRAJAN SUYAMBOO Newbie

                        Hi Adrian,
                        Sorry to send private mail.

                        But I didn't any luck with my durable subscriptions setup , could you please provide steps to configure durable subscriptions?

                        I am using a stand-alone subscriber , though I am successful in publishing messages to topic , my subscriber fails to read published messages. My subsriber uses Listener which implements message listener.

                        Thanks
                        Sundar
                        ssuyamboo@yahoo.com