HornetQ SECURITY_EXCEPTION Unable to Validate User: null
johnwasmat Apr 19, 2013 7:56 AMHello,
Im getting the following exception when trying to send messages to the hornetq queue. I`m using JBoss AS7 with hornetQ embedded. Following is the exception I`m getting
06:29:12,241 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "testwebproj.war"
06:29:34,275 ERROR [org.hornetq.core.server] (Thread-1 (HornetQ-remoting-threads-HornetQServerImpl::serverUUID=79b78d2b-a646-11e2-93c7-dd5f9163e418-945493321-1674741894)) HQ114032: Failed to create session: HornetQException[errorType=SECURITY_EXCEPTION message=HQ119061: Unable to validate user: null]
at org.hornetq.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:145) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.server.impl.HornetQServerImpl.createSession(HornetQServerImpl.java:833) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handleCreateSession(HornetQPacketHandler.java:166) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handlePacket(HornetQPacketHandler.java:82) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:548) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:550) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:511) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:166) [hornetq-core-2.3.0.Alpha.jar:]
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:99) [hornetq-core-2.3.0.Alpha.jar:]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Also following is the client I`m using
Credentials credentials = new UsernamePasswordCredentials("username", "password");
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, credentials);
httpClient.getParams().setAuthenticationPreemptive(true);
ClientExecutor clientExecutor = new ApacheHttpClientExecutor(httpClient);
java.net.URI uri = new java.net.URI("http://127.0.0.1:8080/testwebproj/queues/jms.queue.jmsTesQueue");
ClientRequestFactory fac = new ClientRequestFactory(clientExecutor,uri);
// first get the create URL for the shipping queue
ClientRequest request = fac.createRequest("http://127.0.0.1:8080/testwebproj/queues/jms.queue.jmsTesQueue");
ClientResponse<String> response = request.get(String.class);
ClientResponse res = request.head();
res.releaseConnection();
Link msg_create = res.getHeaderAsLink(MSG_CREATE);
Link msg_pull_consumers = res.getHeaderAsLink(MSG_PULL_CONSUMERS);
System.out.println(MSG_CREATE + ": " + res.getStatus());
res = msg_create.request().body("application/xml", "abc").post();
res.releaseConnection();
if (res.getResponseStatus().getStatusCode() != 201) {
int i=0;
}
I have added "jhu" and "jhu1" as an Application User to JBoss. I have tried with roles as "guest" and it still isnt working. Can someone please help me here. I have been struggling with this for a week now. Thank you.