1 Reply Latest reply on May 4, 2004 2:36 PM by Adrian Brock

    Not able to publish/subscribe messages due to JNDI problems

    Robin Paul Newbie

      Hi

      I am new to Jboss 3.2.3 and i am trying out a sample program to publish messages to a JMS Topic.

      I created my own topic but i dont know what i should look up for getting the reference of the Connection Factory.

      This is the code i am using for creating the publisher

      Context context = new InitialContext(h);

      // Lookup the managed connection factory for a topic
      TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup("TopicConnectionFactory");

      // Create a connection to the JMS provider
      TopicConnection topicConnection = topicFactory.createTopicConnection();

      // Creat a topic session
      TopicSession session = topicConnection.createTopicSession(
      // No transaction
      false,
      // Auto ack
      Session.AUTO_ACKNOWLEDGE);

      // Lookup the destination you want to publish to
      Topic topic = (Topic)context.lookup("topic/revera.topic.refundsTopic");

      // Create a publisher
      TopicPublisher pub = session.createPublisher(topic);


      I am getting
      javax.naming.NameNotFoundException: TopicConnectionFactory not bound
      I tried out this example with Jboss 2.4.3 and it works fine.

      Can some one tell me what i should look up to get the reference of the Connection Factory Reference? and how it configured?

      I am also pasting the relevent portion from my server log file

      2004-05-04 17:38:27,250 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/L:/jboss-3.2.3/server/qr_dev/deploy/jms/jbossmq-destinations-service.xml
      2004-05-04 17:38:27,406 TRACE [org.jboss.system.ServiceController] Scanning for newly supplied classes for waiting mbeans
      2004-05-04 17:38:27,421 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.mq.destination:service=Topic,name=revera.topic.refundsTopic with code: org.jboss.mq.server.jmx.Topic
      2004-05-04 17:38:27,453 TRACE [org.jboss.mq.server.jmx.Topic] Constructing
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.mq.destination:service=Topic,name=revera.topic.refundsTopic
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceController] recording that jboss.mq.destination:service=Topic,name=revera.topic.refundsTopic depends on jboss.mq:service=DestinationManager
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceConfigurator] considering DestinationManager with object name jboss.mq:service=DestinationManager
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceController] recording that jboss.mq.destination:service=Topic,name=revera.topic.refundsTopic depends on jboss.mq:service=SecurityManager
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceConfigurator] considering SecurityManager with object name jboss.mq:service=SecurityManager
      2004-05-04 17:38:27,468 DEBUG [org.jboss.system.ServiceConfigurator] SecurityConf set to



      in jboss.mq.destination:service=Topic,name=revera.topic.refundsTopic
      2004-05-04 17:38:27,468 DEBUG [org.jboss.mq.server.jmx.Topic.revera.topic.refundsTopic] Setting securityConf:





      2004-05-04 17:39:08,109 DEBUG [org.jboss.system.ServiceController] starting service jboss.jca:service=TxCM,name=JmsXA
      2004-05-04 17:39:08,171 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Created securityMgr=org.jboss.security.plugins.JaasSecurityManager@79b177
      2004-05-04 17:39:08,203 INFO [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@16dba0a
      2004-05-04 17:39:08,218 INFO [org.jboss.security.plugins.JaasSecurityManagerService] Added JmsXARealm, org.jboss.security.plugins.SecurityDomainContext@d0f59e to map
      2004-05-04 17:39:08,281 INFO [org.jboss.resource.adapter.jms.JmsManagedConnectionFactory.JmsXA] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/JmsXA'
      2004-05-04 17:39:08,312 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=TxCM,name=JmsXA
      2004-05-04 17:39:08,328 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.jca:service=TxCM,name=JmsXA dependent components: []


      2004-05-04 17:39:33,296 DEBUG [org.jboss.jms.jndi.JBossMQProvider] no provider url; connecting to local JNDI
      2004-05-04 17:39:33,296 DEBUG [org.jboss.jms.jndi.JBossMQProvider] created context: javax.naming.InitialContext@15200be
      2004-05-04 17:39:33,296 ERROR [org.jboss.ejb.plugins.jms.DLQHandler] Initialization failed
      javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound
      at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:169)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:458)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.onException(JMSContainerInvoker.java:1173)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$1.run(JMSContainerInvoker.java:686)
      2004-05-04 17:39:33,421 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Reconnected to JMS provider


      Can some one please help me out on this