6 Replies Latest reply on Apr 23, 2003 6:33 PM by adrian.brock

    getting OIL error when using JVMServerILService

    cconnelly

      I am getting the following error under heavy load of my message queue:
      java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:Native method)
      java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343)
      java.net.ServerSocket.implAccept(ServerSocket.java:438)
      java.net.ServerSocket.accept(ServerSocket.java:409)
      org.jboss.mq.il.oil.OILClientILService.run(OILClientILService.java:127)
      java.lang.Thread.run(Thread.java:536)


      What I do not understand is that I am using the default configuration (JBoss 3.05), which says that I am using org.jboss.mq.il.jvm.JVMServerILService as my JMS invocation layer for persistance.

      If I am truly using the JVM invocation layer, why is JBoss opening up sockets, and why is it using the org.jboss.mq.il.oil.* library?

      I can only guess that jboss either sharing the oil API behind the scense for the JVM invovocation layer, or there is some sort of bug in jboss. The XAConnectionFactoryJNDIRef is very similar for OIL and JVM, with OIL being "XAConnectionFactory" and JVM being "java:/XAConnectionFactory".

        • 1. Re: getting OIL error when using JVMServerILService

          Show the code you use to get the connection

          Regards,
          Adrian

          • 2. Re: getting OIL error when using JVMServerILService
            cconnelly

            public Object invoke(Object[] args)
            throws NamingException, JMSException, Throwable {

            log.debug("JMSInvocationConnector.invoke()");
            // initialize MethodInvocation
            String methodName = "invoke";
            MethodInvocation mi = new MethodInvocation();
            mi.setMethodName(methodName);
            mi.setParams(args);
            ObjectMessage msg = null;

            int ack = Session.AUTO_ACKNOWLEDGE;

            log.debug("JMSInvocationConnector.constructor:queue");

            QueueConnectionFactory factory = null;
            try {
            ctx = new InitialContext();
            factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
            queue = (Queue) ctx.lookup("queue/primaryMBeanQueue");
            } catch (NamingException e) {
            log.error("JMSInvocationConnector.constructor: naming exception");
            throw e;
            }

            log.debug("JMSInvocationConnector.looking up queue and send");

            try {
            connect = factory.createQueueConnection();
            queueSession = connect.createQueueSession(false, ack);
            sender = queueSession.createSender(queue);
            connect.start();

            sender = queueSession.createSender(queue);
            msg = queueSession.createObjectMessage(mi);
            sender.send(msg);
            sender.close();
            } catch (JMSException e) {
            log.error("JMSInvocationConnector.JMSException:" + e.getMessage());
            } finally {
            if (connect != null) {
            try {
            connect.close();
            } catch (JMSException e) {
            log.error("JMSInvocationConnector.JMSException:" + e.getMessage());
            }
            }
            }
            return null;
            }

            • 3. Re: getting OIL error when using JVMServerILService
              cconnelly

              Figured it out, I was using the wrong JNDI name to connect to the ConnectionFactory. Thanks for leading me in the right direction, I thought that the Invocation Layer was purely a JMS configuration issue.

              • 4. Re: getting OIL error when using JVMServerILService

                For others it should be

                factory = (QueueConnectionFactory) ctx.lookup("java:/ConnectionFactory");

                Even better is
                factory = (QueueConnectionFactory) ctx.lookup("java:/JmsXA");
                since that uses JCA to link into the EJB transaction.

                Regards,
                Adrian

                • 5. Re: getting OIL error when using JVMServerILService
                  cconnelly

                  "java:/JmsXA" does this help avoid potential deadlock when the queue listener accesses entity beans.

                  • 6. Re: getting OIL error when using JVMServerILService

                    ? Not sure what this has to do with entity
                    deadlocks.

                    A deadlock is due to access in different orders.

                    Thread1
                    lock A

                    Thread2
                    lock B

                    Thread1
                    try to lock B and wait

                    Thread2
                    try to lock A and wait

                    Both will timeout unless the deadlock is detected
                    and broken earlier.

                    Regards,
                    Adrian