0 Replies Latest reply on Oct 5, 2012 9:22 AM by Marco Baldelli

    jBoss 5.0.1 - topic connection doesn't start

    Marco Baldelli Newbie

      hi all,

      i'm new here and i need a little help. i have configured on my jBoss 5.0.1 (running under eclipse helios, ubuntu 12.04 64-bit as OS) a new connection factory and a topic queue for my messages.

       

      configurations posted down here, from connection-factories-service.xml (first portion) and destinations-service.xml (second one):

       

      ...

         <!-- connection factory -->    

         <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"

            name="jboss.messaging.connectionfactory:service=MyConnectionFactory"

            xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">

            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

            <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>

            <depends>jboss.messaging:service=PostOffice</depends>

           

            <attribute name="JNDIBindings">

               <bindings>

                  <binding>jms/MyConnectionFactory</binding>

               </bindings>

            </attribute>

         </mbean>

      ...

         <mbean xmbean-dd="xmdesc/Topic-xmbean.xml"

            name="jboss.messaging.destination:service=Topic,name=MyTopic"

            code="org.jboss.jms.server.destination.TopicService">

            <attribute name="JNDIName">topic/MyTopic</attribute>

            <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

            <depends>jboss.messaging:service=PostOffice</depends>

         </mbean>

      ...

       

      i have a servlet where i wrote basic instruction for calling my topic, here's the code:

       

      Properties p = new Properties();

      p.put("java.naming.factory.initial",           "org.jnp.interfaces.NamingContextFactory");

      p.put("java.naming.factory.url.pkgs",          "org.jboss.naming:org.jnp.interfaces");

      p.put("java.naming.provider.url",                    "localhost:1099");

       

      InitialContext ctx = new InitialContext(p);

      JBossTopic topic = (JBossTopic) ctx.lookup("topic/MyTopic");

      JBossConnectionFactory topicConnectionFactory =(JBossConnectionFactory) ctx.lookup("jms/MyConnectionFactory");

      TopicConnection topicConnection = topicConnectionFactory.createTopicConnection();

      topicConnection.start();

      TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

       

      // create a queue sender

      TopicPublisher topicSender = topicSession.createPublisher(topic);

      topicSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

       

      MyDTO myDTO = getMessage(); //internal method

      ObjectMessage  message = topicSession.createObjectMessage(myDTO);

      // send the message

      topicSender.send(message);

       

       

      doing this, my execution stops to topicConnection.start(); (i checked it with a debug and some custom log message). i'm not getting any error, stacktrace exception or something, the browser page where i call my servlet just stands waiting for a response.

      i used JBossTopic and JBossConnectionFactory due to some ClassCastException from JBoss when i tried to use simple javax.jms Topic and TopicConnectionFactory.

       

      could someone help me with this? i'm getting totally mad!!!

       

       

      thanks in advance,

      marco