Results 1 to 2 of 2

Thread: "Transport is not running" with acitiveMQ, JNDI

  1. #1
    Join Date
    Jan 2007
    Posts
    9

    Default "Transport is not running" with acitiveMQ, JNDI

    I'm trying, for the first time, to connect an application to ActiveMQ the proper way under Tomcat, using JNDI Resources. Not having much luck so far. I'm stuck on the message

    javax.jms.JMSException: The transport is not running.
    There seems to be an associated message:

    java.io.IOException: Unknown data type: 105
    at org.apache.activemq.openwire.OpenWireFormat.doUnma rshal(OpenWireFormat.java:342)
    at org.apache.activemq.openwire.OpenWireFormat.unmars hal(OpenWireFormat.java:273)
    at org.apache.activemq.transport.tcp.TcpTransport.rea dCommand(TcpTransport.java:156)
    at org.apache.activemq.transport.tcp.TcpTransport.run (TcpTransport.java:136)
    In server.xml I define the following JNDI resources:
    Code:
        <Resource auth="Container" description="JMS Connection factory"
        name="jms/ConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="tcp://ccdwaretest:7676"
        clientID="OCSRelay" useEmbeddedBroker="false" userName="guest" password="guest" />
        <Resource name="jms/ocsTopic" auth="Container" type="org.apache.activemq.command.ActiveMQTopic" description="my Topic"
            factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="OCS_RELAYED"/>
    Then I bring them in the applicationcontext.xml as:

    Code:
        <jee:jndi-lookup id="jmsConnectionFactory" jndi-name="jms/ConnectionFactory"
            resource-ref="true" proxy-interface="javax.jms.ConnectionFactory"/>
            <bean id="transactionManager" class="org.springframework.jms.connection.JmsTransactionManager"
            p:connectionFactory-ref="jmsConnectionFactory"/>
        <jee:jndi-lookup id="ocsTopic" jndi-name="jms/ocsTopic" resource-ref="true" proxy-interface="javax.jms.Topic"/>
        <tx:annotation-driven/>
    My first try was without the transaction manager, but I got essentially the same error, it just happens on sending the message rather that trying to start a transaction.

    Here's the code:

    Code:
    @Transactional
    public class OCSPublishSMSImpl implements OCSPublish {
    
        private ConnectionFactory connectionFactory;
        private Destination ocsTopic;
    
        public void publishOcsMessage(final String xml, final Map<String, String> properties) {
            JmsTemplate template = new JmsTemplate(connectionFactory);
            template.setPubSubDomain(true);
            
            ProducerCallback process = new ProducerCallback() {
    
                public Object doInJms(Session sn, MessageProducer mp) throws JMSException {
                    Message msg = sn.createTextMessage(xml);
                    for (Map.Entry<String, String> prop : properties.entrySet()) {
                        msg.setStringProperty(prop.getKey(), prop.getValue());
                    }
                    mp.send(msg);
                    return null;
                }
            };
            template.execute(ocsTopic, process);
        }
    The broker on dcdwaretest is up and running, and I've used it without problems using the fsContext method of setting parameters.
    Last edited by soupdragon; Jun 21st, 2010 at 08:14 AM.

  2. #2
    Join Date
    Jan 2007
    Posts
    9

    Default

    Oops! I though I must be doing something really dumb, and I was right

    Trying to point an activeMQ client at an openMQ broker isn't the best idea.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •