This has only been noticed once and not easy to reproduce. Below is the
exception stacktrace when the problem happened while a multi-threaded MQ
test running
The ArrayStoreException happened on (multi-threads run concurrently)
String userpwd = MD5.getHashString("guest" + ":" + "guest");
where MD5 does following:
----------------
public static String getHashString(String plaintext) {
try {
return convertToString(getHash(plaintext.getBytes("UTF8")));
} catch (java.io.UnsupportedEncodingException e) {
throw new RuntimeException(e.toString());
}
}
public static byte[] getHash(byte[] plainText) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
return md.digest(plainText);
}
catch(Exception e) {
throw new RuntimeException(e.toString());
}
}
public static String convertToString(byte[] digest_ba) {
return new BigInteger(digest_ba).toString(16);
}
-------------------------------------------
com.sun.messaging.jms.JMSException: [C4038]: java.lang.ArrayStoreException
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:327)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:279)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:585)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:263)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:33)
at com.sun.messaging.jmq.jmsclient.TopicConnectionImpl.<init>(TopicConnectionImpl.java:30)
at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:102)
at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:87)
at test.jmsserver.conn.conLoad.TestRun.runTest(ThreadTest.java:203)
at test.jmsserver.conn.conLoad.TestRun.run(ThreadTest.java:166)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ArrayStoreException
at java.math.BigInteger.toString(BigInteger.java:2570)
at com.sun.messaging.jmq.util.MD5.convertToString(MD5.java:41)
at com.sun.messaging.jmq.util.MD5.getHashString(MD5.java:24)
at com.sun.messaging.jmq.jmsclient.auth.JMQDigestAuthenticationHandler.handleRequest(JMQDigestAuthenticationHandler.java:58)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.authenticate(ProtocolHandler.java:714)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:668)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:604)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.hello(ConnectionImpl.java:332)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1743)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:561)
... 8 more
Linked ex is java.lang.ArrayStoreException
java.lang.ArrayStoreException
at java.math.BigInteger.toString(BigInteger.java:2570)
at com.sun.messaging.jmq.util.MD5.convertToString(MD5.java:41)
at com.sun.messaging.jmq.util.MD5.getHashString(MD5.java:24)
at com.sun.messaging.jmq.jmsclient.auth.JMQDigestAuthenticationHandler.handleRequest(JMQDigestAuthenticationHandler.java:58)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.authenticate(ProtocolHandler.java:714)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:668)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:604)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.hello(ConnectionImpl.java:332)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1743)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:561)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:263)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:33)
at com.sun.messaging.jmq.jmsclient.TopicConnectionImpl.<init>(TopicConnectionImpl.java:30)
at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:102)
at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:87)
at test.jmsserver.conn.conLoad.TestRun.runTest(ThreadTest.java:203)
at test.jmsserver.conn.conLoad.TestRun.run(ThreadTest.java:166)
at java.lang.Thread.run(Thread.java:534)
Received error on testAutocreate6, iteration 9, exiting thread early