2 Replies Latest reply on Feb 22, 2007 1:36 AM by Sumit Malik

    JNDI look up of remote interface is not working

    Sumit Malik Newbie

      Hi All,

      I have googled this problem a lot but coudnt able to find answer of this. Any assistance would be appreciated because i m just stuck up here,,,

      I m using jboss4.0.4CR2 on linux

      When, I m calling remote interface of a stateless session bean then its giving me the following error.

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at mailTest.main(mailTest.java:25)
      Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)
       at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:531)
       at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
       at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
       at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
       at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
       at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
       at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
       ... 3 more
      


      My Client code looks like this
      try {
      
       Hashtable<String,String> environment = new Hashtable<String,String>();
       environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       environment.put(Context.PROVIDER_URL, "jnp://10.0.0.10:1099"); // remote machine IP
       InitialContext context = new InitialContext(environment);
       Object obj = context.lookup("EmailSessionBean/remote");
       //EmailFacade home = (EmailFacade)PortableRemoteObject.narrow(obj, EmailFacade.class);
      
       System.out.println("lookup done successfully");
      
       }
       catch (Exception e) {
       System.out.println("exception caught");
       e.printStackTrace();
       }


      When i invoke list on jndi view its giving me the following

      +- EmailSessionBean (class: org.jnp.interfaces.NamingContext)
       | +- remote (proxy: $Proxy113 implements interface com.sumit.email.ejb.interfaces.session.EmailFacade,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
       +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
       +- com.sumit.ejb.ifaces.CalculatorPOJO (class: java.lang.Object)
       +- jmx (class: org.jnp.interfaces.NamingContext)
       | +- invoker (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor (proxy: $Proxy34 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
       | +- rmi (class: org.jnp.interfaces.NamingContext)
       | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
       +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- com.sumit.ejb.ifaces.CalculatorPOJOPRODUCER_FACTORY (proxy: $Proxy97 implements interface org.jboss.ejb3.ProxyFactory)
       +- UserTransactionSessionFactory (proxy: $Proxy35 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
       +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
       +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
       +- queue (class: org.jnp.interfaces.NamingContext)
       | +- D (class: org.jboss.mq.SpyQueue)
       | +- C (class: org.jboss.mq.SpyQueue)
       | +- B (class: org.jboss.mq.SpyQueue)
       | +- A (class: org.jboss.mq.SpyQueue)
       | +- testQueue (class: org.jboss.mq.SpyQueue)
       | +- mdb (class: org.jboss.mq.SpyQueue)
       | +- ex (class: org.jboss.mq.SpyQueue)
       | +- injection (class: org.jboss.mq.SpyQueue)
       | +- DLQ (class: org.jboss.mq.SpyQueue)
       | +- emailEngine (class: org.jboss.mq.SpyQueue)
       | +- mdpojo (class: org.jboss.mq.SpyQueue)
       +- topic (class: org.jnp.interfaces.NamingContext)
       | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
       | +- testTopic (class: org.jboss.mq.SpyTopic)
       | +- securedTopic (class: org.jboss.mq.SpyTopic)
       +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
       +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
       +- newGeneric (class: org.jnp.interfaces.NamingContext)
       | +- EntityCalculatorBean (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy103 implements interface com.sumit.ejb.ifaces.CalculatorEntity,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       | +- TransCalculatorBean (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy104 implements interface com.sumit.ejb.ifaces.CalculatorTransaction,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       | +- StatelessCalculator (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy98 implements interface com.sumit.ejb.Calculator,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       | +- RecordManagerBean (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy99 implements interface com.sumit.ejb.injection.RecordManager,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       | +- ApptransCalculatorBean (class: org.jnp.interfaces.NamingContext)
       | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
       | | +- local (class: java.lang.Object)
       | +- SessionLCalculator (class: org.jnp.interfaces.NamingContext)
       | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
       | | +- local (class: java.lang.Object)
       | +- sessfCalculatorBean (class: org.jnp.interfaces.NamingContext)
       | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
       | | +- local (class: java.lang.Object)
       | +- UpdateCalculatorBean (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy105 implements interface com.sumit.ejb.ifaces.CalculatorUpdate,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       | +- CalculatorMBean (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy100 implements interface com.sumit.ejb.jmx.Calculator,interface org.jboss.ejb3.JBossProxy)
       +- EventDispatcher (class: org.jboss.ws.eventing.mgmt.DispatcherDelegate)
       +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)


      I am calling my server bean interface with adding this jar in client classpath
      /usr/local/jboss-4.0.4.CR2/client/jboss-aspect-jdk50-client.jar

      and i do have jboss-ejb3.jar in $jboss_home/server/default/deploy/ejb3.deployer

      Please suggest me where the problem is...

      Thanks in anticipation