Authentication and connection to JMS Queue
boru Jul 5, 2002 5:55 PMI wish to start using JMS and Message Beans with JBOSS 3.0.0, but I have run into
authentication problems on what seems to bee a very simple case:
I want to send a message to a JBOSS queue from a different JVM than JBOSS is running in.
I start with the JBOSS example program "SendRecvClient" and make the following mods to get an
initial context, and to change the name of the factory to the current one ("ConnectionFactory").
I then compile and run against a clean freshly downloaded no mod version of JBoss 3.0.0.
it fails with the error below.
it seems to be complaining about not being able to connect to a socket during the creation
of a queue connection? localhost:1099 is the correct location, right?
I have looked at the QUickStart guide chapter 11 but there is no discussion of the QueConnection?
Any help would be appreciated.
----------------------------------------------------------
public void setupPTP()
throws JMSException, NamingException
{
Properties props = new Properties();
props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
props.setProperty("java.naming.provider.url","localhost:1099");
InitialContext iniCtx = new InitialContext(props);
Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
que = (Queue) iniCtx.lookup("queue/testQueue");
session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
}
---------------------------------------------------------
Begin sendRecvAsync
org.jboss.mq.SpyJMSException: Cannot authenticate user
at org.jboss.mq.Connection.authenticate(Connection.java:766)
at org.jboss.mq.Connection.(Connection.java:233)
at org.jboss.mq.Connection.(Connection.java:264)
at org.jboss.mq.SpyConnection.(SpyConnection.java:59)
at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:96)
at test.SendRecvClient.setupPTP(SendRecvClient.java:62)
at test.SendRecvClient.sendRecvAsync(SendRecvClient.java:74)
at test.SendRecvClient.main(SendRecvClient.java:98)
linked exception is:
java.net.SocketException: Option unsupported by protocol: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.(Socket.java:273)
at java.net.Socket.(Socket.java:127)
at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:490)
at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:478)
at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:266)
at org.jboss.mq.Connection.authenticate(Connection.java:759)
at org.jboss.mq.Connection.(Connection.java:233)
at org.jboss.mq.Connection.(Connection.java:264)
at org.jboss.mq.SpyConnection.(SpyConnection.java:59)
at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:96)
at test.SendRecvClient.setupPTP(SendRecvClient.java:62)
at test.SendRecvClient.sendRecvAsync(SendRecvClient.java:74)
at test.SendRecvClient.main(SendRecvClient.java:98)
Exception in thread "main"