1 Reply Latest reply on Dec 15, 2004 12:09 PM by Adrian Brock

    Problem with ConnectionFactory and UnmarshalException

    Yannick Berete Newbie

      Sorry to disturb you...
      I am beginner of jboss, I use JBoss 4.0 (default server configuration) and I cannot find any useful document to solve my problem...
      It seems there are lot of problems with ConnectionFactory binding... and UnmarshalException
      I use a basic tutorial ... Please tell what is wrong ...

      thank you very much ...

      Here my code

      private InitialContext getContext() throws NamingException {
      
      Hashtable props = new Hashtable();
      props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
       "org.jnp.interfaces.NamingContextFactory");
      
      props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");
      
      props.put(props.put(InitialContext.URL_PKG_PREFIXES,
       "org.jboss.naming:org.jnp.interfaces" );
      
      
      InitialContext initialContext = new InitialContext(props);
      return initialContext;
      }
      ...
      
      private void executeMdb() {
      
      try {
       InitialContext ctx = getContext();
       System.out.println("executeMdb: InitialContext OK...");
       System.out.println("executeMdb: InitialContext : " + ctx );
      
       // just to see all context names
       NamingEnumeration enum = ctx.list(ctx.getNameInNamespace());
       while (enum.hasMore()){
       System.out.println("Naming Context " + enum.next());
       }
      
       QueueConnectionFactory factory = (QueueConnectionFactory)
       ctx.lookup("ConnectionFactory");
       System.out.println("executeMdb: lookup ConnectionFactory OK...");
      
      ...
      



      The output is something like that:

      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:648)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at ch.epfl.hightech.client.CustomerSessionBMPClient.executeMdb(CustomerSessionBMPClient.java:162)
      at ch.epfl.hightech.client.CustomerSessionBMPClient.testBean(CustomerSessionBMPClient.java:132)
      at ch.epfl.hightech.client.CustomerSessionBMPClient.main(CustomerSessionBMPClient.java:196)


      thanks for all !!

        • 1. 3857603
          Adrian Brock Master

           


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


          This is not the correct forum for basic Java questions.
          We have a beginners forums for newbies.

          Fix your classpath and move along.