1 Reply Latest reply on Nov 21, 2003 4:53 AM by palma

    principal=null

    palma Newbie

      Hi,

      I'm using JMS to distribute messages among servers. The main server has a Topic, and I put the messages in this Topic through a Stateless Session Bean. There is a MDB that listens to this Topic and publishes the messages in the Topics of the others servers. This works, but after a while I get the following exception:

      org.jboss.mq.SpyJMSException: Cannot process a transaction; - nested throwable: (java.lang.SecurityException: Invalid authentication attempt, principal=null)

      I've seen this raised many times in these forums but I can't find the answer for my problem. I'm using jboss-3.2.2RC3, the Topics are "non persistent", "non transacted" and there is no security configuration.

      The MDB makes the connection on ejbCreate and releases the connection on ejbRemove. The MDB publishes the messages this way:

      public void onMessage( Message message ) {
      TopicSession session = null;
      TopicPublisher publisher = null;
      try {
      session = _topicConnection.createTopicSession( false, Session.AUTO_ACKNOWLEDGE );
      publisher = session.createPublisher( _topic );
      publisher.setDeliveryMode( DeliveryMode.NON_PERSISTENT );
      publisher.publish( message );
      } catch ( JMSException e ) {
      _logger.error( e );
      } finally {
      try {
      if (publisher != null) {
      publisher.close();
      }
      if (session != null) {
      session.close();
      }
      } catch (JMSException e) {
      _logger.error(e);
      }
      }
      }

      The MDB declaration in the jboss.xml:

      <message-driven>
      <ejb-name>AuditoriumToRoomMDB</ejb-name>
      <destination-jndi-name>topic/auditoriumAnswersTopic</destination-jndi-name>
      <mdb-user>guest</mdb-user>
      <mdb-passwd>guest</mdb-passwd>
      </message-driven>


      The Stateless Session Bean publishes the messages this way:

      connection = connectionFactory.createTopicConnection( "guest", "guest" );
      connection.start();
      session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      publisher = session.createPublisher(topic);
      publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
      publisher.publish(message);


      There is an Exception when I publish the message and other Exception in the server.log:

      2003-11-17 17:49:00,901 ERROR [br.com.cit.components.chat.auditorium.moderator.services.impl.AuditoriumServicesImpl] Erro enviando mensagem na fila JMS
      org.jboss.mq.SpyJMSException: Cannot send a message to the JMS server; - nested throwable: (java.lang.SecurityException: Invalid authentication attempt, principal=null)
      at org.jboss.mq.Connection.sendToServer(Connection.java:1251)
      at org.jboss.mq.SpySession.sendMessage(SpySession.java:720)
      at org.jboss.mq.SpyTopicPublisher.internalPublish(SpyTopicPublisher.java:120)
      at org.jboss.mq.SpyTopicPublisher.publish(SpyTopicPublisher.java:68)
      at br.com.cit.components.chat.auditorium.moderator.services.impl.AuditoriumServicesImpl.sendMessage(Unknown Source)
      at br.com.cit.components.chat.auditorium.moderator.services.impl.AuditoriumServicesImpl.sendBroadcastMessage(Unknown Source)
      at br.com.cit.components.chat.auditorium.moderator.services.impl.ejb.EJBAuditoriumServicesBean.sendBroadcastMessage(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      at sun.rmi.transport.Transport$1.run(Transport.java:147)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:479)
      + nested throwable:
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      <<no stack trace available>>


      ----------------------------------------
      The exception in the server.log:


      2003-11-17 17:47:36,912 DEBUG [org.jboss.mq.SpySession] Session closing.
      2003-11-17 17:47:36,919 ERROR [org.jboss.jms.asf.StdServerSession] failed to commit/rollback
      org.jboss.mq.SpyXAException: - nested throwable: (org.jboss.mq.SpyJMSException: Cannot process a transaction; - nested throwable: (java.lang.SecurityException: Invalid authentication attempt, principal=null))
      at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:105)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:307)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
      at org.jboss.mq.SpySession.run(SpySession.java:298)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
      at java.lang.Thread.run(Thread.java:479)
      + nested throwable:
      org.jboss.mq.SpyJMSException: Cannot process a transaction; - nested throwable: (java.lang.SecurityException: Invalid authentication attempt, principal=null)
      at org.jboss.mq.Connection.send(Connection.java:932)
      at org.jboss.mq.SpyXAResourceManager.commit(SpyXAResourceManager.java:127)
      at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:103)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:307)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
      at org.jboss.mq.SpySession.run(SpySession.java:298)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
      at java.lang.Thread.run(Thread.java:479)
      + nested throwable:
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:701)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:508)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:839)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.getConnection(PersistenceManager.java:1225)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.createPersistentTx(PersistenceManager.java:616)
      at org.jboss.mq.pm.TxManager.createTx(TxManager.java:79)
      at org.jboss.mq.server.JMSDestinationManager.transact(JMSDestinationManager.java:426)
      at org.jboss.mq.server.JMSServerInterceptorSupport.transact(JMSServerInterceptorSupport.java:185)
      at org.jboss.mq.server.TracingInterceptor.transact(TracingInterceptor.java:370)
      at org.jboss.mq.server.JMSServerInvoker.transact(JMSServerInvoker.java:187)
      at org.jboss.mq.il.jvm.JVMServerIL.transact(JVMServerIL.java:328)
      at org.jboss.mq.Connection.send(Connection.java:928)
      at org.jboss.mq.SpyXAResourceManager.commit(SpyXAResourceManager.java:127)
      at org.jboss.mq.SpyXAResource.commit(SpyXAResource.java:103)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:307)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
      at org.jboss.mq.SpySession.run(SpySession.java:298)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
      at java.lang.Thread.run(Thread.java:479)



      If anybody can help me out here I would very much appreciate it.

      Thanks,
      Adriano