9 Replies Latest reply on Aug 18, 2003 2:20 PM by adrian.brock

    JMSException: The subscription provided does not exist.

    big-r

      I'm a JMS/JBoss newbie, trying to execute a simple app that consumes messages from a topic. I'm using JBoss 4.0 DR2, and following an example from Sun's tutorial. I get "JMSException: The subscription provided does not exist." when calling the Consumer.receive() method.

      Here's a snippet:

      try {
      connectionFactory = (ConnectionFactory)
      jndiContext.lookup("java:/ConnectionFactory");
      dest = (Queue) jndiContext.lookup("java:/queue/A");

      } catch (Exception e) {
      System.out.println("JNDI API lookup failed: " +
      e.toString());
      System.exit(1);
      }

      try {
      connection = connectionFactory.createConnection();
      session = connection.createSession(false,
      Session.AUTO_ACKNOWLEDGE);
      consumer = session.createConsumer(dest);
      connection.start();
      while (true) {
      Message m = consumer.receive(1);
      if (m != null) {
      if (m instanceof TextMessage) {
      message = (TextMessage) m;
      System.out.println("Reading message: " +
      message.getText());
      } else {
      break;
      }
      }
      }
      } catch (JMSException e) {
      System.out.println("Exception occurred: " +
      e.toString());
      } finally {
      if (connection != null) {
      try {
      connection.close();
      } catch (JMSException e) {}
      }
      }

      Any ideas?

      Thx.

        • 1. Re: JMSException: The subscription provided does not exist.
          big-r

          woops... the code snippet acutally shows that I'm trying to get stuff from a Queue... In either case (queue or topic), I get the same exception.

          • 2. Re: JMSException: The subscription provided does not exist.

            I would expect the createConsumer to throw an exception
            since it is unlikely you have a Queue in that location.
            Try removing the java:/ from the queue name.

            Regards,
            Adrian

            • 3. Re: JMSException: The subscription provided does not exist.
              big-r

              Adrian, thanks for the response... much appreciated.

              I was only receiving an exception when calling receive(), but I did remove java:/ as you suggested. Unfortunately, this had no effect - I'm still getting the same exception when making the call to receive()... :(

              • 4. Re: JMSException: The subscription provided does not exist.

                Can you enable trace for org.jboss.mq in conf/log4j.xml
                Therea are some examples in that file, and post
                the Exception from the TraceInterceptor.

                Any other strange messages might also be useful.

                Regards,
                Adrian

                • 5. Re: JMSException: The subscription provided does not exist.
                  big-r

                  TRACE is below.... I actually got this working by changing my code to use the Topic interfaces instead of the parent interfaces. But it should work the original way, right?

                  2003-08-15 10:14:58,284 TRACE [org.jboss.mq.il.oil.OILServerILService] Setting TcpNoDelay Option to:true
                  2003-08-15 10:14:58,284 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : authenticate
                  2003-08-15 10:14:58,294 TRACE [org.jboss.mq.security.ServerSecurityInterceptor] Autenticating user null/null
                  2003-08-15 10:14:58,425 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] initialize
                  2003-08-15 10:14:58,425 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] Saw unauthenticatedIdentity=guest
                  2003-08-15 10:14:58,435 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] login
                  2003-08-15 10:14:58,445 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] Authenticating as unauthenticatedIdentity=guest
                  2003-08-15 10:14:58,445 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] User 'guest' authenticated, loginOk=true
                  2003-08-15 10:14:58,445 TRACE [org.jboss.mq.sm.file.DynamicLoginModule] commit, loginOk=true
                  2003-08-15 10:14:58,505 TRACE [org.jboss.mq.security.SecurityManager] Username: null is authenticated
                  2003-08-15 10:14:58,555 TRACE [org.jboss.mq.security.SecurityManager] Adding group : class org.jboss.security.NestableGroup Roles(members:guest)
                  2003-08-15 10:14:58,555 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : authenticate
                  2003-08-15 10:14:58,836 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : ping
                  2003-08-15 10:14:58,836 TRACE [org.jboss.mq.server.TracingInterceptor] ARG : 1060964098836
                  2003-08-15 10:14:58,836 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: 192.168.1.242:3236
                  2003-08-15 10:14:58,836 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : ping
                  2003-08-15 10:14:59,479 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : getID
                  2003-08-15 10:14:59,479 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : getID
                  2003-08-15 10:15:01,366 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : setEnabled
                  2003-08-15 10:15:01,366 TRACE [org.jboss.mq.server.TracingInterceptor] ARG : true
                  2003-08-15 10:15:01,426 TRACE [org.jboss.mq.server.ClientConsumer] ClientConsumer:ID:1->setEnabled(enabled=true)
                  2003-08-15 10:15:01,426 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : setEnabled
                  2003-08-15 10:15:02,340 DEBUG [org.juddi.util.UUID] jUDDI's UUID cache size: 20
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : receive
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.server.TracingInterceptor] ARG : 0
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.server.TracingInterceptor] ARG : 1
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.security.ServerSecurityInterceptor] Checking receive authorize on SpyDistributedConnection:ID:1/c265c18ca4e96964858dc708a280e973 subId=0
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.server.TracingInterceptor] EXCEPTION : receive:
                  javax.jms.JMSException: The provided subscription does not exist
                  at org.jboss.mq.server.ClientConsumer.getSubscription(ClientConsumer.java:355)
                  at org.jboss.mq.server.JMSDestinationManager.getSubscription(JMSDestinationManager.java:847)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.getSubscription(JMSServerInterceptorSupport.java:313)
                  at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:98)
                  at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:482)
                  at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:221)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:275)
                  at java.lang.Thread.run(Thread.java:536)
                  2003-08-15 10:15:02,561 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : receive
                  2003-08-15 10:15:02,561 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
                  javax.jms.JMSException: The provided subscription does not exist
                  at org.jboss.mq.server.ClientConsumer.getSubscription(ClientConsumer.java:355)
                  at org.jboss.mq.server.JMSDestinationManager.getSubscription(JMSDestinationManager.java:847)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.getSubscription(JMSServerInterceptorSupport.java:313)
                  at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:98)
                  at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:482)
                  at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:221)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:275)
                  at java.lang.Thread.run(Thread.java:536)
                  2003-08-15 10:15:04,810 TRACE [org.jboss.mq.server.TracingInterceptor] CALLED : connectionClosing
                  2003-08-15 10:15:04,810 TRACE [org.jboss.mq.server.ClientConsumer] ClientConsumer:ID:1->close()
                  2003-08-15 10:15:04,820 TRACE [org.jboss.mq.il.oil.OILClientIL] Closing OILClientIL
                  2003-08-15 10:15:04,820 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN : connectionC

                  • 6. Re: JMSException: The subscription provided does not exist.

                    Why should it work if you use the Topic interfaces, you are
                    using a Queue aren't you?

                    What is the output of dest.getClass().getName()

                    The server shows no attempt to make a subscription,
                    can you try getting a TRACE log on the client?

                    Regards,
                    Adrian

                    • 7. Re: JMSException: The subscription provided does not exist.
                      big-r

                      Sorry for the confusion, Adrian. I've been going back and forth in my code, using both Queue and Topic... my latest code uses a Topic.

                      Here is some output from my client:

                      JNDI InitialContext: javax.naming.InitialContext@a4e743
                      Got a ConnectionFactory: org.jboss.mq.SpyConnectionFactory
                      Got a Destination: org.jboss.mq.SpyTopic, toString()=TOPIC.testTopic
                      Got a Connection: org.jboss.mq.SpyConnection
                      Got a Session: org.jboss.mq.SpySession
                      Got a Consumer: org.jboss.mq.SpyTopicSubscriber
                      Started connection...
                      Calling consumer.receive()...
                      Exception occurred: javax.jms.JMSException: The provided subscription does not exist

                      I'm also attaching my latest code...

                      Thx again for the responses.

                      • 8. Re: JMSException: The subscription provided does not exist.
                        big-r

                        Here's more output from the server console as well.... strange that there's a SocketException right before the JMSException. Very suspicous.... sorry I hadn't seen this before. Maybe this indicates something to you? Thx.

                        10:38:02,310 WARN [OILServerILService] Connection failure (1).
                        java.net.SocketException: Connection reset
                        at java.net.SocketInputStream.read(SocketInputStream.java:168)
                        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
                        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
                        at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java
                        :2133)
                        at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(Object
                        InputStream.java:2316)
                        at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStre
                        am.java:2383)
                        at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream
                        .java:2455)
                        at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputSt
                        ream.java:2604)
                        at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
                        at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.
                        java:186)
                        at java.lang.Thread.run(Thread.java:536)
                        10:39:05,287 WARN [OILServerILService] Client request resulted in a server exce
                        ption:
                        javax.jms.JMSException: The provided subscription does not exist
                        at org.jboss.mq.server.ClientConsumer.getSubscription(ClientConsumer.jav
                        a:355)
                        at org.jboss.mq.server.JMSDestinationManager.getSubscription(JMSDestinat
                        ionManager.java:847)
                        at org.jboss.mq.server.JMSServerInterceptorSupport.getSubscription(JMSSe
                        rverInterceptorSupport.java:313)
                        at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurit
                        yInterceptor.java:98)
                        at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.jav
                        a:482)
                        at org.jboss.mq.server.JMSServerInvoker.receive(JMSServerInvoker.java:22
                        1)
                        at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.
                        java:275)
                        at java.lang.Thread.run(Thread.java:536)

                        • 9. Re: JMSException: The subscription provided does not exist.

                          That message says the client dropped the connection?
                          You need to find out what is happening on the client side.

                          Regards,
                          Adrian