<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    jBoss 5.0.1 - topic connection doesn't start
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/marcob83">Marco Baldelli</a> in <i>JBoss Messaging Development</i> - <a href="https://community.jboss.org/message/763491#763491">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>hi all,</p><p>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. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>configurations posted down here, from connection-factories-service.xml (first portion) and destinations-service.xml (second one):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>...</p><p>&#160;&#160; &lt;!-- connection factory --&gt;&#160;&#160;&#160;&#160; </p><p>&#160;&#160; &lt;mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"</p><p>&#160;&#160;&#160;&#160;&#160; name="jboss.messaging.connectionfactory:service=MyConnectionFactory"</p><p>&#160;&#160;&#160;&#160;&#160; xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml"&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends optional-attribute-name="Connector"&gt;jboss.messaging:service=Connector,transport=bisocket&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160; &lt;attribute name="JNDIBindings"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bindings&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding&gt;jms/MyConnectionFactory&lt;/binding&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bindings&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/attribute&gt;</p><p>&#160;&#160; &lt;/mbean&gt;</p><p>...</p><p>&#160;&#160; &lt;mbean xmbean-dd="xmdesc/Topic-xmbean.xml" </p><p>&#160;&#160;&#160;&#160;&#160; name="jboss.messaging.destination:service=Topic,name=MyTopic" </p><p>&#160;&#160;&#160;&#160;&#160; code="org.jboss.jms.server.destination.TopicService"&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;attribute name="JNDIName"&gt;topic/MyTopic&lt;/attribute&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;</p><p>&#160;&#160; &lt;/mbean&gt;</p><p>...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>i have a servlet where i wrote basic instruction for calling my topic, here's the code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Properties p = new Properties();</p><p>p.put("java.naming.factory.initial",&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;"org.jnp.interfaces.NamingContextFactory");</p><p>p.put("java.naming.factory.url.pkgs",&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;"org.jboss.naming:org.jnp.interfaces");</p><p>p.put("java.naming.provider.url",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;"localhost:1099");</p><p>&#160; </p><p>InitialContext ctx = new InitialContext(p);</p><p>JBossTopic topic = (JBossTopic) ctx.lookup("topic/MyTopic");</p><p>JBossConnectionFactory topicConnectionFactory =(JBossConnectionFactory) ctx.lookup("jms/MyConnectionFactory");</p><p>TopicConnection topicConnection = topicConnectionFactory.createTopicConnection();</p><p>topicConnection.start();</p><p>TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>// create a queue sender</p><p>TopicPublisher topicSender = topicSession.createPublisher(topic);</p><p>topicSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>MyDTO myDTO = getMessage(); //internal method</p><p>ObjectMessage&#160; message = topicSession.createObjectMessage(myDTO);</p><p>// send the message</p><p>topicSender.send(message);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p>i used JBossTopic and JBossConnectionFactory due to some ClassCastException from JBoss when i tried to use simple javax.jms Topic and TopicConnectionFactory.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>could someone help me with this? i'm getting totally mad!!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>thanks in advance,</p><p>marco</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/763491#763491">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2043">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>