7 Replies Latest reply on Jun 5, 2008 11:13 PM by peterj

    classloader issue

    randiz

      hi

      I am trying to call a method in a session bean deployed on server (call it server1 ) that processes some data and then pushes the data on a queue existing on a external jboss server( call it server 2). tjhe session bean is unable to push the data on queue on server 2 ( the know the queue on server2 exists )

      I get the following error :

      ERROR javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.jms.destination.JBossQueue (no security manager: RMI class loader disabled)]

      the code for reference is simple refer below :

      properties.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES,
      "org.jboss.naming:org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");

      context = new InitialContext(properties1);
      queue = (Queue) context.lookup("queue/JMS_action_Request");
      QueueConnectionFactory tcf = (QueueConnectionFactory)context.lookup("ConnectionFactory");
      queueConnection = tcf.createQueueConnection();
      queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      QueueSender queueSender =queueSession.createSender(queue);
      queueConnection.start();
      queueSender.send(queueSession.createTextMessage(msg));
      queueSession.commit();
      queueConnection.close();

      any clues to the problem and how to handle this problem

      thanks
      randiz

        • 1. Re: classloader issue
          peterj

          Are server1 and server2 running the same version of jbossas? What version?

          Also, did you replace JBossMQ with JBoss Messaging? I ask because the missing class belongs to JBossMQ. If you did not replace JBossMQ with JBoss Messaging, then you have the wrong forum.

          According to this line:

          properties.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");

          you will end up with the connection factory on the local server (server1), not the remote server (server2). You need to change that to use the hostname of the server2.

          • 2. Re: classloader issue
            randiz

            I am using jboss 4.2.2GA without any changes so I dont know whether its using JBossMQ or jboss messaging. Both servers exist on localhost but use different ports. The hostname and port of destination queue are correct. ( otherwise I would have gotten queue not found exception)

            randiz

            • 3. Re: classloader issue
              randiz

              also server1 is using jboss4.2.2 GA and the server2 is using jbossesb-server-4.2.1GA messaging queue.

              • 4. Re: classloader issue
                peterj

                4.2.2 comes with JBossMQ. I am not sure what jbossesb uses.

                • 5. Re: classloader issue
                  randiz


                  I tried to install jbossmessaging in 4.2.2GA as pre wiki but get the following message :

                  16:38:37,400 WARN [ServiceController] Problem starting service jboss.messaging:service=ServerPeer
                  java.lang.IllegalArgumentException: Unable to find operation getInvokerLocator()

                  Any clue as to how I can get it work ?

                  thanks
                  randiz

                  • 6. Re: classloader issue
                    randiz


                    ok I succesfully managed to send a message to quue on server 2. AllI ahd to do was move over jboss-messaging.jar and jboss-messaging-client.jar into jboss 4.2.2GA install. Thanx peterJ for you input.

                    • 7. Re: classloader issue
                      peterj

                      Glad you got it up and running.

                      I was f=going to ask which version of messaging you installed and the steps you used to install it. The util/release-admin.xml ant script that comes with messaging should have copied those jars for you.