2 Replies Latest reply on Jan 13, 2013 1:58 PM by Joan navarrete

    HornetQException / JMSSecurityException (Failed to create session, errorCode=105, user:null, unable to validate user)

    Kousik Rajendran Newbie

      Hi,

      I am trying to establish JMS connection using two JBOSS AS 7.1 servers for my application.

      Both has HornetQ Configured with the Spring implementation in application. Now, what happens is, when my producer sends a message to consumer, both producer and consumer throws exceptions like this,

       

      Producer Log:


      16:06:22,466 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/***].[com.aayuwiz.gateways.SyncGateway]] (http-0.0.0.0-0.0.0.0-8080-1) Servlet.service() for servlet com.***.SyncGateway threw exception: org.springframework.jms.JmsSecurityException: Unable to validate user: null; nested exception is javax.jms.JMSSecurityException: Unable to validate user: null

              at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:291) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at com.sphata.core.jms.sender.SyncJmsMessageSender.produceSyncMessage(SyncJmsMessageSender.java:17) [sphata_platform.jar:]

              at com.aayuwiz.gateways.SyncGateway.doPost(SyncGateway.java:75) [classes:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at com.aayuwiz.gateways.filters.SessionFilter.doFilter(SessionFilter.java:114) [classes:]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_01]

      Caused by: javax.jms.JMSSecurityException: Unable to validate user: null

              at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:312) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:780) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:279) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:601) [hornetq-jms-2.2.13.Final.jar:]

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:684) [hornetq-jms-2.2.13.Final.jar:]

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119) [hornetq-jms-2.2.13.Final.jar:]

              at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:114) [hornetq-jms-2.2.13.Final.jar:]

              at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:178) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:150) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456) [org.springframework.jms-3.1.0.RC2.jar:3.1.0.RC2]

              ... 22 more

      Caused by: HornetQException[errorCode=105 message=Unable to validate user: null]

              ... 33 more

       

       

      Consumer Log:


      16:04:56,448 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 5726ms - Started 170 of 249 services (78 services are passive or on-demand)

      16:06:22,222 ERROR [org.hornetq.core.protocol.core.impl.HornetQPacketHandler] (Old I/O server worker (parentId: 10621391, [id: 0x00a211cf, /0.0.0.0:15445])) Failed to create session : HornetQException[errorCode=105 message=Unable to validate user: null]

              at org.hornetq.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:147) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.server.impl.HornetQServerImpl.createSession(HornetQServerImpl.java:807) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handleCreateSession(HornetQPacketHandler.java:187) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handlePacket(HornetQPacketHandler.java:85) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:508) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:556) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:517) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73) [hornetq-core-2.2.13.Final.jar:]

              at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline$StaticChannelHandlerContext.sendUpstream(StaticChannelPipeline.java:534) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287) [netty-3.2.6.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.decode(HornetQFrameDecoder2.java:169) [hornetq-core-2.2.13.Final.jar:]

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134) [hornetq-core-2.2.13.Final.jar:]

              at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:367) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:100) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44) [netty-3.2.6.Final.jar:]

              at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181) [netty-3.2.6.Final.jar:]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_01]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_01]

              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_01]

       

      Here is the spring bean configuration of application code

       

            <bean name="hqconnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter" p:username="user" p:password="apache" >

                          <property name="targetConnectionFactory">

                                    <bean name="hqconnectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">

                                              <constructor-arg name="ha" value="false" />

                                              <constructor-arg>

                                                        <bean class="org.hornetq.api.core.TransportConfiguration">

                                                                  <constructor-arg

                                                                            value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" />

                                                                  <constructor-arg>

                                                                            <map key-type="java.lang.String" value-type="java.lang.Object">

                                                                                      <entry key="host" value="192.168.1.235"/>

                                                                                      <entry key="port" value="15445"/>

                                                                            </map>

                                                                  </constructor-arg>

                                                        </bean>

                                              </constructor-arg>

                                    </bean>

                          </property>

                </bean>

       

      I have attached the standalone-full.xml (my application configuration file)

       

      please help me out to establish proper configuration so that my JMS works fine.