Doesn't that error "method not implemented" usually come from compiling with an IDE and setting the flag to ignore failed compilation?
If that is right, make sure you are using the pre-built jars for activemq and not ones built by an IDE. Sent from my iPhone > On Feb 27, 2014, at 2:25 AM, "mcJony [via ActiveMQ]" > <ml-node+s2283324n4678384...@n4.nabble.com> wrote: > > I will like to use Activemq as a websocket message broker. > I used it before, but always with TCP socket (topics). Activemq (version: > 5.6.0) is running in same computer, but not as an embedded broker. Now I will > like to use it with websocket. > > The client side is done (webrowser with html5 and websockets), it connects to > the broker, but I'm having problems in my Java application. My java > application must send messages to broker and this to the clients, but when I > try to create the connection in the java application with the broker, the > following exception is thrown: "Could not create Transport. Reason: > java.io.IOException: createTransport() method not implemented!" > > > > I don't know what is wrong. Here is my code: > > > /***** > > public class WebSocketProducer implements ExceptionListener { > > private static WebSocketProducer instance = null; > private Context ctx = null; > private TopicSession session = null; > private Properties properties = null; > private TopicConnection connection = null; > > private WebSocketProducer() throws ProducerException{ > init(); > } > > private void init() throws ProducerException { > try { > Properties defaults = new Properties(); > defaults.setProperty("java.naming.factory.initial", > > "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); > defaults.setProperty("java.naming.provider.url", > "ws://localhost:61614"); > //read the configuration file (wjms.properties) > properties = > Utilities.getProperties("wjms.properties", defaults); > > ctx = new InitialContext(properties); > TopicConnectionFactory connectionFactory = > (TopicConnectionFactory) > ctx.lookup("TopicConnectionFactory"); > connection = > connectionFactory.createTopicConnection(); > connection.setExceptionListener(this); > connection.start(); > session = connection.createTopicSession( > false, Session.AUTO_ACKNOWLEDGE); > > > } catch (Exception e) { > ProducerException mpe = new ProducerException(); > mpe.initCause(e); > throw mpe; > } > } > > public void publishMessage(String topic, Message message) throws > MessageException { > > > try { > Topic myTopic = (Topic)ctx.lookup(topic); > TopicPublisher publisher = > session.createPublisher(myTopic); > // Messages will expire in 24h > publisher.setTimeToLive(86400000L); > publisher.publish(message); > publisher.close(); > } catch (Exception e) { > String messageId = ""; > try { > messageId = (message != null) ? > message.getJMSMessageID() : ""; > } catch (JMSException e1) { > e1.printStackTrace(); > } > MessageException me = new > MessageException(messageId); > me.initCause(e); > throw me; > } > } > } > > *****/ > > > If you reply to this email, your message will be added to the discussion > below: > http://activemq.2283324.n4.nabble.com/Could-not-create-Transport-Reason-java-io-IOException-createTransport-method-not-implemented-tp4678384.html > To start a new topic under ActiveMQ - User, email > ml-node+s2283324n234180...@n4.nabble.com > To unsubscribe from ActiveMQ - User, click here. > NAML -- View this message in context: http://activemq.2283324.n4.nabble.com/Could-not-create-Transport-Reason-java-io-IOException-createTransport-method-not-implemented-tp4678384p4678397.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.