[WARNING] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293) at java.lang.Thread.run(Thread.java:745) Caused by: javax.jms.JMSSecurityException: HQ119031: Unable to validate user: null at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:399) at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:880) at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:789) at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:324) at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:654) at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:676) at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:119) at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:114) at org.huahsin.jms1.MetaData.main(MetaData.java:30) ... 6 more Caused by: HornetQException[errorType=SECURITY_EXCEPTION message=HQ119031: Unable to validate user: null] ... 15 moreThis time is HornetQ is unable to validate the user. I was running some test code on JMS which shows this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Context context = null; | |
QueueConnection qConn = null; | |
final Properties env = new Properties(); | |
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); | |
env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, "remote://localhost:4447")); | |
env.put(Context.SECURITY_PRINCIPAL, System.getProperty("username", "quickstartUser")); | |
env.put(Context.SECURITY_CREDENTIALS, System.getProperty("password", "quickstartPwd1!")); | |
context = new InitialContext(env); | |
String connStr = System.getProperty("connection.factory", "jms/RemoteConnectionFactory"); | |
QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(connStr); | |
qConn = factory.createQueueConnection(); | |
... | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>javax.jms</groupId> | |
<artifactId>jms</artifactId> | |
<version>1.1</version> | |
</dependency> |
Somehow there is a workaround for this, disable the HornetQ security in standalone-full.xml:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<hornetq-server> | |
… | |
<security-enabled>false</security-enabled> | |
</hornetq-server> |
No comments:
Post a Comment