Cannot authenticate user - why is that?
arabin Oct 20, 2003 3:21 PMI have the following code:
public class PerformanceTesterSender
{
//static CountDown done = new CountDown(1);
public void sendRecvAsync(String text)
throws JMSException, NamingException
{
QueueConnection conn = null;
QueueSession session = null;
Queue que = null;
//Logging.debugInfoLog("Begin sendRecvAsync");
// Setup the PTP connection, session
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("QueueConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
que = (Queue) iniCtx.lookup("queue/testQueue");
session = conn.createQueueSession(false,
QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
// Set the async listener
QueueReceiver recv = session.createReceiver(que);
//recv.setMessageListener(new ExListener());
// Send a text msg
QueueSender send = session.createSender(que);
TextMessage tm = session.createTextMessage(text);
send.send(tm);
//Logging.debugInfoLog("sendRecvAsync, sent text="
// + tm.getText());
send.close();
//Logging.debugInfoLog("End sendRecvAsync");
conn.stop();
session.close();
conn.close();
}
public static void main(String args[]) throws Exception
{
for (int ii=0; ii< 1000; ii++)
{
PerformanceTesterSender client = new PerformanceTesterSender();
String msg = "Text Message " + ii + " " + ServiceTimer.getFormattedTime();
Logging.debugInfoLog("Sending " + msg);
client.sendRecvAsync(msg);
}
//client.done.acquire();
//done.acquire();
Thread a = new Thread (new PerformanceTester());
a.start();
Logging.debugInfoLog("Started");
while(true)
Thread.sleep(10000);
//System.exit(0);
}
}
Logging.debugInfoLog is just a wrapper around Syste,.out.println()
I have the following exception:
Exception in thread "main" org.jboss.mq.SpyJMSException: Cannot authenticate use
r; - nested throwable: (java.net.BindException: Address already in use: connect)
at org.jboss.mq.Connection.authenticate(Connection.java:883)
at org.jboss.mq.Connection.(Connection.java:238)
at org.jboss.mq.Connection.(Connection.java:315)
at org.jboss.mq.SpyConnection.(SpyConnection.java:60)
at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnection
Factory.java:116)
at com.wrn.teamworks.cms.client.PerformanceTesterSender.sendRecvAsync(Pe
rformanceTesterSender.java:34)
at com.wrn.teamworks.cms.client.PerformanceTesterSender.main(Performance
TesterSender.java:63)
Caused by: java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.(Socket.java:309)
at java.net.Socket.(Socket.java:153)
at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563
)
at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)
at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
at org.jboss.mq.Connection.authenticate(Connection.java:876)
... 6 more
What does it mean?