5 Replies Latest reply on Apr 16, 2003 12:37 PM by k1mzg

    SpyJMSException: Cannot authenticate user -- what to do?

    blueser

      Hi all,

      I hope this is a trivial question, but we have already googled around looking for a clue to no avail... I thought maybe you guys shed some light on this.

      Using JBoss 3.0.6 running either on WinXP or Linux RH 8.0, clients also tested on both platforms, JDK 1.4.1. Inserted JAVA_OPTS=-Djava.rmi.server.hostname=[jboss server ip] on run.sh. The jndi.properties used is:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=jnp://[server ip]:1099

      This tiny code snippet

      === snippet start ===
      InitialContext initCtx = new InitialContext(); Object tmp = initCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection("guest", "guest");
      queue = (Queue) initCtx.lookup("queue/testQueue");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      QueueSender send = session.createSender(que);
      TextMessage tm = session.createTextMessage(greeting);
      send.send(tm);
      send.close();
      === snippet end ===

      Generates this exception right when the connection with the queue is attempted (remainder ommitted for simplicity)

      === stacktrace start ===
      org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.net.ConnectException: Connection timed out)
      at org.jboss.mq.Connection.authenticate(Connection.java:769)
      at org.jboss.mq.Connection.(Connection.java:233)
      at org.jboss.mq.SpyConnection.(SpyConnection.java:48)
      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)
      [...]
      ======

      It seems obvious guest/guest isn't recognized as a valid user/passwd pair on the server. However, this is the default JBoss configuration -- wasn't this supposed to work?

      Pls let me know if you need additional info.

      TIA,

      Andre

        • 1. Re: SpyJMSException: Cannot authenticate user -- what to do?

          It looks like you client cannot see the
          server, probably because the ip mapping
          is incorrect.

          The default connection factory is OIL which
          uses plain sockets. The RMI setting won't
          help you here.

          Regards,
          Adrian

          • 2. Re: SpyJMSException: Cannot authenticate user -- what to do?
            bdavies

            I am also getting this exception now under what sounds like the exact same situation. If i find anything i'll certainly post it here. Thx for any help you guys can provide...

            • 3. Re: SpyJMSException: Cannot authenticate user -- what to do?
              bdavies

              But won't the RMI setting help with RMIIL?

              • 4. Re: SpyJMSException: Cannot authenticate user -- what to do?
                blueser

                Hi Adrian, thks for lending a hand =)

                It makes sense... we dropped the JAVA_OPTS setting since it was ineffective, thks for pointing that out.

                We were performing tests in two different contexts: within a subnet and between two different networks. We also extended our test to send a msg and then consume its own message.

                Using the default ConnectionFactory (OIL) within the subnet we get a situation where the server apparently cannot talk back to the client (error messages below are _server_ side):

                19:17:43,515 ERROR [OILClientIL] Cannot connect to the
                ConnectionReceiver/Server
                java.net.ConnectException: Connection refused: connect
                [...]
                19:17:43,535 WARN [OILServerILService] Client request resulted in a
                server exception:
                org.jboss.mq.SpyJMSException: Could not pong; - nested throwable:
                (java.rmi.RemoteException: Cannot connect to the
                ConnectionReceiver/Server)
                [...]
                19:17:44,717 ERROR [OILClientIL] Cannot connect to the
                ConnectionReceiver/Server
                [...]

                We learned that OIL and RMI depend on a connection back to the caller, so we tried replacing the

                initCtx.lookup("ConnectionFactory");
                for
                initCtx.lookup("UILConnectionFactory");

                and this apparently did the trick within the subnet (although I wouldn't guess we could have IP probls within the same subnet). However, this didn't help between the different networks (in this case, there are two firewalls involved). On this scenario, the client seems to hang forever, while the server doesn't complain a single word.

                Any ideas? (sorry for the long post, I just wanted to provide as much info as I could)

                TIA

                Andre

                • 5. Re: SpyJMSException: Cannot authenticate user -- what to do?
                  k1mzg

                  I'm also getting an SpyJMSException trying to connect,
                  but only using jdk1.3.1_04 on the client. This is error #1
                  below. Error #2 is using jdk1.4.0_2 on the client and is
                  from the JBoss console window.

                  Andy help would be appreciated. We would really like to
                  be able to use jdk1.3.1_04 on the client.

                  TIA

                  1. ============================
                  org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.net.SocketException: Option unsupported by protocol: connect)
                  at org.jboss.mq.Connection.authenticate(Connection.java:882)
                  at org.jboss.mq.Connection.(Connection.java:237)
                  at org.jboss.mq.SpyConnection.(SpyConnection.java:48)
                  at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)

                  2. ============================
                  11:11:27,390 WARN [OILServerILService] Client request resulted in a server exception:
                  javax.jms.JMSSecurityException: User: sa is NOT authenticated
                  at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.java:181)
                  at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSecurityInterceptor.java:40)
                  at org.jboss.mq.server.TracingInterceptor.authenticate(TracingInterceptor.java:650)
                  at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.java:288)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:328)
                  at java.lang.Thread.run(Thread.java:536)