0

I have to change the configuration of an already setup jboss 4.0.2 environment. the Topic that was already established, it needed a name change. so i changed it in the places it needed like properties files under /home/jboss-4.0.2/server/myappinstance/conf/ and the main jboss service.xml files which listed the Topic

mytopic-Destination-service.xml

<server>
  <!-- event publish destination -->
  <mbean code="org.jboss.mq.server.jmx.Topic"
     name="jboss.mq.destination:service=Topic,name=myTopic">
    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  </mbean>

</server>

and myapp-jms-destinations-service.xml ( pretty much the same thing, not sure why it was originally splitted out)

<?xml version="1.0" encoding="UTF-8"?>
<server>
    <mbean code="org.jboss.naming.NamingAlias" name="jboss.mq:service=NamingAlias,fromName=issues/incomingEvent">
                    <attribute name="ToName">topic/myTopic</attribute>
                    <attribute name="FromName">issues/incomingEvent</attribute>
            </mbean>
   </server

> the error i get in the jboss log is like:

    org.jboss.deployment.DeploymentException: Error during topic setup; - nested throwable: (org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: ; - nested throwable: (java.lang.NullPointerException)) 
.........
 ......
 .... 

Caused by: org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: ;
    - nested throwable: (java.lang.NullPointerException)
            at org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:66)
            at org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:51)
            at org.jboss.mq.Connection.addConsumer(Connection.java:835)
            at org.jboss.mq.SpyConnectionConsumer.<init>(SpyConnectionConsumer.java:95)
            at org.jboss.mq.SpyConnection.createDurableConnectionConsumer(SpyConnection.java:156)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:789)
            ... 140 more Caused by: java.lang.NullPointerException
            at org.jboss.mq.sm.AbstractStateManager.setDurableSubscription(AbstractStateManager.java:134)
            at org.jboss.mq.server.JMSTopic.addSubscriber(JMSTopic.java:95)
            at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:133)
            at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:596)

if you notice where it says : org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: ;

there is a space between 'Destination:' and ';' meaning the name of the destination is null. Now when i use the original name which was LP1 it was fine when i change it to myTopic it gives me this error. I searched on this issue and it seems it is a config issue but i cant seem to pin point where the issue is.

I checked the code the topic name is not hardcoded in the code either. i removed the work and tmp directories as well just to remove any cached configs.

sarmahdi
  • 1,098
  • 4
  • 21
  • 61
  • Did you remove the messaging database files? Or, did you unsubscribe the subscription to the topics original name? I'm thinking that the code knows about the subscription the the original topic name, but a topic with that name no longer exists. – Doug Grove Jun 13 '18 at 13:54
  • What is the messaging database file? hmm your answer makes sense. I am shutting down the jboss, would that not un subscribe the subscription to the Topic. – sarmahdi Jun 13 '18 at 23:01
  • 1
    If you are using the 'in memory only' hypersonic database for messaging, then your subscription would not survive a server restart. If you are using a database for your messaging, then the subscription does survive a database restart. Have a look at the files in the server profiles `deploy-hasingleton/jms` directory. – Doug Grove Jun 15 '18 at 11:33
  • I think that was it. I had a hypersonic DB with a JMS_SUBSCRPTION table and there the name of the topic was different so i corrected that and it worked. thanks – sarmahdi Jun 18 '18 at 01:13

1 Answers1

1

Did you remove the messaging database files? Or, did you unsubscribe the subscription to the topics original name? I'm thinking that the code knows about the subscription the the original topic name, but a topic with that name no longer exists.

Doug Grove
  • 962
  • 5
  • 5
  • There was a hypersonic database, with a table called JMS_SUBSCRIPTION in which the Topic name was different. that was the topic that was being used. your answer guided me to that DB and look into its script. Though i had to remove the data directory which was remade. – sarmahdi Jun 19 '18 at 02:23