activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shamilds <>
Subject Enterprise application throws unknown protocol tcp exception
Date Fri, 03 Feb 2012 18:03:33 GMT
Hi all,

Im new to ActiveMQ and glassfish configurations. Im trying to run ActiveMQ
as a separate application and listening to tcp:// connections.
The use an ejb application to connect to tcp:// url and send
messages to myTopic.

First i started the activeMQ. it starts successfully, then login to admin
panel and created a topic call myTopic. The im trying to send messages to
this topic using an ejb. Here is my ejb code:

Properties props = new Properties();           
javax.naming.Context ctx = new InitialContext(props);

javax.jms.TopicConnectionFactory factory =
javax.jms.TopicConnection conn = factory.createTopicConnection();
javax.jms.Topic mytopic =
javax.jms.TopicSession session =

producer = session.createProducer(mytopic);
TextMessage mesg = session.createTextMessage("Text message!");

When i try to call this function it throws me following exception:

Caused by: javax.naming.ConfigurationException: Invalid URL:
tcp:// [Root exception is
Unknown protocol: tcp]
        at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(
        at com.sun.jndi.cosnaming.CNCtx.<init>(

I tried this one with file as well. but same result.
Im using glassfish 3.0.1 as ejb container
java 1.6
ActiveMQ 5.4.3

can anybody help me..
many thanks

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message