11 Replies Latest reply on Oct 21, 2003 4:33 PM by Raja

    Cannot authenticate user - why is that?

    arabin Novice

      I have the following code:

      public class PerformanceTesterSender
      {
      //static CountDown done = new CountDown(1);

      public void sendRecvAsync(String text)
      throws JMSException, NamingException
      {
      QueueConnection conn = null;
      QueueSession session = null;
      Queue que = null;
      //Logging.debugInfoLog("Begin sendRecvAsync");
      // Setup the PTP connection, session
      InitialContext iniCtx = new InitialContext();
      Object tmp = iniCtx.lookup("QueueConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup("queue/testQueue");
      session = conn.createQueueSession(false,
      QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      // Set the async listener
      QueueReceiver recv = session.createReceiver(que);
      //recv.setMessageListener(new ExListener());
      // Send a text msg
      QueueSender send = session.createSender(que);
      TextMessage tm = session.createTextMessage(text);
      send.send(tm);
      //Logging.debugInfoLog("sendRecvAsync, sent text="
      // + tm.getText());
      send.close();
      //Logging.debugInfoLog("End sendRecvAsync");
      conn.stop();
      session.close();
      conn.close();
      }


      public static void main(String args[]) throws Exception
      {
      for (int ii=0; ii< 1000; ii++)
      {
      PerformanceTesterSender client = new PerformanceTesterSender();
      String msg = "Text Message " + ii + " " + ServiceTimer.getFormattedTime();
      Logging.debugInfoLog("Sending " + msg);
      client.sendRecvAsync(msg);
      }
      //client.done.acquire();
      //done.acquire();
      Thread a = new Thread (new PerformanceTester());
      a.start();
      Logging.debugInfoLog("Started");
      while(true)
      Thread.sleep(10000);
      //System.exit(0);
      }

      }

      Logging.debugInfoLog is just a wrapper around Syste,.out.println()

      I have the following exception:

      Exception in thread "main" org.jboss.mq.SpyJMSException: Cannot authenticate use
      r; - nested throwable: (java.net.BindException: Address already in use: connect)

      at org.jboss.mq.Connection.authenticate(Connection.java:883)
      at org.jboss.mq.Connection.(Connection.java:238)
      at org.jboss.mq.Connection.(Connection.java:315)
      at org.jboss.mq.SpyConnection.(SpyConnection.java:60)
      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnection
      Factory.java:116)
      at com.wrn.teamworks.cms.client.PerformanceTesterSender.sendRecvAsync(Pe
      rformanceTesterSender.java:34)
      at com.wrn.teamworks.cms.client.PerformanceTesterSender.main(Performance
      TesterSender.java:63)
      Caused by: java.net.BindException: Address already in use: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at java.net.Socket.(Socket.java:309)
      at java.net.Socket.(Socket.java:153)
      at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
      at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563
      )
      at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)

      at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
      at org.jboss.mq.Connection.authenticate(Connection.java:876)
      ... 6 more


      What does it mean?

        • 1. Re: Cannot authenticate user - why is that?
          Raja Master

          Check out if port 8090 is being used by some other app.

          Caused by: java.net.BindException: Address already in use: connect is for OILServerILSErvice and the default port is 8090

          -Raj

          • 2. Re: Cannot authenticate user - why is that?
            arabin Novice

            Forgot to mention. What is happening in the loop - this exception does not happen on EVERY iteration. Just sometimes. So, you suggestion does not work right. Thanks anyway.

            • 3. Re: Cannot authenticate user - why is that?
              Raja Master

              Check out the number of allowed connections on ur machine. Looks like the Connections max out and its not able to create/connect new connections.

              Alternatively, try using JVMServerILService instead of the OILserver

              -Raj

              • 4. Re: Cannot authenticate user - why is that?
                arabin Novice

                Check out the number of allowed connections on ur machine.

                How can I do that? Is there a configuration for connection pool in JBoss? Where?


                Alternatively, try using JVMServerILService instead of the OILserver

                How can I do that?

                • 5. Re: Cannot authenticate user - why is that?
                  John Childress Newbie

                  Arabin,

                  don't know why, don't care.... Already spent a day working on this sh*t....

                  I rolled back to RC4 and the error went away...

                  Works like you expect.. .Aghhhh

                  I know it's free, but dammm can't things work the same between releases...?

                  John

                  • 6. Re: Cannot authenticate user - why is that?
                    arabin Novice

                    Are you talking about this particular error or about something else?
                    I am still working with RC3. The problem I described is on RC3.
                    Are you saying it disappeared on RC4 and appeared again on 3.2.2 final release?

                    • 7. Re: Cannot authenticate user - why is that?
                      John Childress Newbie

                      All I'm saying is that I have the following situation....

                      JBoss calc server, has a single mdb listening to an incoming queue. When a message is received, he does some work, and a reponse to an outgoing queue.

                      I have a fat swing client that sends the initial message to the JBoss incoming queue and receives the results from the outbound queue.

                      During dev it work'd fine while both the client and server were on the same machine... Diff vms, but same machine.

                      When I attempted to move the client to a diff box, and the server to the prod box I received the same error you did. "auth error, then connection refused below"

                      I even received the same exception/error using a vanilla JBoss install, with the example pubsub client from the JBoss Admin docs.

                      I then reverted back to RC4 and the errors were gone on both the sample client and my swing app. Don't ask why I went back, just vodoo ;-)

                      Anyway, I love JBoss, we've been using it for prod "real-time" apps for over two years now. It's great, sorry I was just venting earlier.... :-)

                      Anyway, working now with RC4, going to production with RC4.

                      John

                      • 8. Re: Cannot authenticate user - why is that?
                        arabin Novice

                        Following your advice, I tried it on RC4. The result is still the same - starting certain iteration, I have this kind of exception.

                        org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (jav
                        a.net.ConnectException: Connection refused: connect)
                        at org.jboss.mq.Connection.authenticate(Connection.java:883)
                        at org.jboss.mq.Connection.(Connection.java:238)
                        at org.jboss.mq.Connection.(Connection.java:315)
                        at org.jboss.mq.SpyConnection.(SpyConnection.java:60)
                        at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnection
                        Factory.java:116)
                        at com.wrn.teamworks.cms.client.PerformanceTesterSender.sendRecvAsync(Pe
                        rformanceTesterSender.java:63)
                        at com.wrn.teamworks.cms.client.PerformanceTesterSender.run(PerformanceT
                        esterSender.java:37)
                        at java.lang.Thread.run(Thread.java:534)
                        Caused by: java.net.ConnectException: Connection refused: connect
                        at java.net.PlainSocketImpl.socketConnect(Native Method)
                        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                        at java.net.Socket.connect(Socket.java:452)
                        at java.net.Socket.connect(Socket.java:402)
                        at java.net.Socket.(Socket.java:309)
                        at java.net.Socket.(Socket.java:153)
                        at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
                        at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563
                        )
                        at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)

                        at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
                        at org.jboss.mq.Connection.authenticate(Connection.java:876)
                        ... 7 more

                        • 9. Re: Cannot authenticate user - why is that?
                          John Childress Newbie

                          Arabin,

                          sorry. Just thought I'd share my exp with you.

                          Good luck, JBoss really is working great for us. Hang in there and see if anyone else has a suggestion.

                          Have you tried just running a simple test? Not using you app, but a vanilla install and a simple jms "console type" client?

                          John

                          • 10. Re: Cannot authenticate user - why is that?
                            arabin Novice

                            I guess that code I put in the beginning is rather simple.

                            • 11. Re: Cannot authenticate user - why is that?
                              Raja Master

                              How do you register QueueConnectionFactory?

                              Try looking up java:/ConnectionFactory instead of ConnectionFactory. I think the first is for JVMIL and the second for OIL. Not sure on this, but give it a try.