4 Replies Latest reply on Jan 18, 2008 4:12 AM by erasmomarciano

    [JAVA-JMS]+Jboss confiurazione

    erasmomarciano

      I have this problem

      Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
      java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr (no security manager: RMI class loader disabled)]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at erasmo.jms.Sender.main(Sender.java:45)




      I have configured this file
      /home/erasmo/jboss-4.0.5.GA/server/nodo1/deploy/jms/hajndi-jms-ds.xml

      Add this row


      queue/order







      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager



      queue/mail
      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager



      I have an application standalone in Java

      ....................
      TextMessage message_topic = null;

      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "10.173.174.1");
      // properties.put(Context.SECURITY_AUTHENTICATION, "no");
      // properties.put(Context., "no");

      ctx = new InitialContext(properties);

      //Queue Initializzation
      cf = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
      destination = (Queue)ctx.lookup("queue/order");
      connection = cf.createQueueConnection();
      session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
      sender = session.createSender(destination);

      .............


      But when i run my java application the answer is the following:

      TextMessage message_topic = null;

      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "10.173.174.1");
      // properties.put(Context.SECURITY_AUTHENTICATION, "no");
      // properties.put(Context., "no");

      ctx = new InitialContext(properties);

      //Queue Initializzation
      cf = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
      destination = (Queue)ctx.lookup("queue/order");
      connection = cf.createQueueConnection();
      session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
      sender = session.createSender(destination);


        • 1. Re: [JAVA-JMS]+Jboss confiurazione
          jaikiran

           

          java.lang.ClassNotFoundException: org.jboss.mq.referenceable.ObjectRefAddr


          Place the jbossall-client.jar (which can find from %JBOSS_HOME%/server/client folder) in the classpath your client (erasmo.jms.Sender).



          • 2. Re: [JAVA-JMS]+Jboss confiurazione
            erasmomarciano

            I have try
            but now i have this error

            xception in thread "main" javax.naming.NameNotFoundException: order not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
            at sun.rmi.transport.Transport$1.run(Transport.java:153)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
            at java.lang.Thread.run(Thread.java:595)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
            at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at erasmo.jms.Sender.main(Sender.java:55)


            I have add code in my class java

            System.setProperty("java.security.policy", "c:/client.policy");
            if (System.getSecurityManager() == null)

            {
            System.setSecurityManager(new RMISecurityManager());
            }


            Properties properties = new Properties();
            properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
            properties.put(Context.PROVIDER_URL, "10.173.172.176");
            // properties.put(Context.SECURITY_AUTHENTICATION, "no");
            //properties.put(Context., "no");

            ctx = new InitialContext(properties);




            • 3. Re: [JAVA-JMS]+Jboss confiurazione
              erasmomarciano

              I have found the error







              Thanks you

              • 4. Re: [JAVA-JMS]+Jboss confiurazione
                erasmomarciano

                I've forgotten to post error