Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1351

Make persistent topic with durable subscriber MDB

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • JBossAS-4.0.1 Final
    • JCA service, JMS (JBossMQ)
    • None

    Description

      We would like to make persistent topic, with one MDB as a durable subscriber. We use the convenience configuration for JMS in EJB2.1 when using JBoss's inbound jms resource adapter as is described at the following page:
      http://www.jboss.org/wiki/Wiki.jsp?page=ConfigJBoss4MDB
      Using the <mdb-client-id> tag in jboss.xml we received an exception, saying that the JMSActivationSpec does not have a clientID property (with uppercase 'ID' at the end!)

      I.
      Setting the "clientId" activation-config-property (see attached part of ejb-jar.xml) to an existing user's clientId (jms_users table) with the proper password and username values (jboss.xml) causes the following exception during the deployment:

      12:22:16,531 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@7834eb

      javax.jms.IllegalStateException: The connection has already a clientID
      at org.jboss.mq.Connection.setClientID(Connection.java:523)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupTopicConnection(JmsActivation.java:425)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:370)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:259)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:514)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:200)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:261)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
      at java.lang.Thread.run(Unknown Source)

      We observed that the setupTopicConnection(Context, String, String, String) method (see the stacktrace above) is called twice during the deployment and the second call results the exception.

      II.
      Using the dLQClientID (standardjboss.xml) with the same value as in the MDB config (ejb-jar.xml),
      <activation-config-property>
      <activation-config-property-name>dLQClientID</activation-config-property-name>
      <activation-config-property-value>Uj</activation-config-property-value>
      </activation-config-property>
      also causes the JmsActivationSpec to be called twice resulting an exception:

      14:02:23,843 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@13552ed
      org.jboss.mq.SpyJMSException: Cannot get a client ID; - nested throwable: (javax.jms.JMSSecurityException: The login id has an assigned client id 'Uj', that is already connected to the server!)
      at org.jboss.mq.Connection.askForAnID(Connection.java:1143)
      at org.jboss.mq.Connection.<init>(Connection.java:258)
      at org.jboss.mq.SpyConnection.<init>(SpyConnection.java:55)
      at org.jboss.mq.SpyConnectionFactory.createConnection(SpyConnectionFactory.java:108)
      at org.jboss.mq.SpyConnectionFactory.createTopicConnection(SpyConnectionFactory.java:141)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupTopicConnection(JmsActivation.java:421)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:370)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:259)
      at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:514)
      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:200)
      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:261)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
      at java.lang.Thread.run(Unknown Source)
      Caused by: javax.jms.JMSSecurityException: The login id has an assigned client id 'Uj', that is already connected to the server!
      at org.jboss.mq.sm.AbstractStateManager.checkUser(AbstractStateManager.java:169)
      at org.jboss.mq.server.JMSDestinationManager.checkUser(JMSDestinationManager.java:758)
      at org.jboss.mq.server.JMSServerInterceptorSupport.checkUser(JMSServerInterceptorSupport.java:274)
      at org.jboss.mq.server.TracingInterceptor.checkUser(TracingInterceptor.java:749)
      at org.jboss.mq.server.JMSServerInvoker.checkUser(JMSServerInvoker.java:274)
      at org.jboss.mq.il.jvm.JVMServerIL.checkUser(JVMServerIL.java:287)
      at org.jboss.mq.Connection.askForAnID(Connection.java:1137)
      ... 12 more

      III.
      Finally we tried to use a new clientId in the ejb-jar.xml ("Ujj") and delete the <mdb-xxx> tags from the jboss.xml, and the dLQClientID property from the standardjboss.xml, and use the quest user in the following way:
      <activation-config-property>
      <activation-config-property-name>dLQUser</activation-config-property-name>
      <activation-config-property-value>guest</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
      <activation-config-property-name>dLQPassword</activation-config-property-name>
      <activation-config-property-value>guest</activation-config-property-value>
      </activation-config-property>
      which resulted in succesfully creating a persistent topic. All the messages get the 'A' txop, get delivered to the MDB, and messages are also redelivered after server restart. So the topic seems to be persistent. However no messages are marked to be delete (no 'D' values for txop column in the jms_messages table). The jms_transactions table is empty, which means that all the transactions are commited.

      We are not sure that we do exactly what is supposed to do however we presume that the above settings should not cause exceptions. Unfortunately there are several conflicting information sources on the web in connection with this problem thus we can not find any suggestions how to do this correctly under jboss 4.0.1, and EJB2.1.

      http://www.magnolia.info/wiki/Diff.jsp?page=HowtoSecureTheJBossServer&r1=2&r2=1
      http://www.junlu.com/msg/46204.html - we can do durable subscription programatically but not with MDB
      http://www.huihoo.com/jboss/online_manual/3.0/ch08s20.html - 3.0 manual, and EJB2.0
      http://pipin.tmd.ns.ac.yu/extra/java2/libs/JBoss/ch07s07.html

      Best regards, Zsolt.

      Attachments

        Activity

          People

            adrian.brock Adrian Brock (Inactive)
            pati-23 Zsolt Tar (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified