5 Replies Latest reply on Jun 14, 2006 7:09 AM by Jerry Gauthier

    Error on lookup From a clustered SLSB to another clustered S

    davide pasquero Newbie

      Hello,



      My situation is that I'm using JBoss 4.0.3SP1 and I have SLSB#1 in a cluster trying to connect to SLSB#2 in a different cluster. I can do it find using the regular JNDI, but as soon as I try to use the HA-JNDI it fails to do the lookup with a NameNotFoundException.

      jboss.xml for SLSB#2:

      
       <session>
       <ejb-name>MyStatless</ejb-name>
       <jndi-name>ejb/MyStatless</jndi-name>
      
       <clustered>true</clustered>
      
       </session>
      


      Global JNDI Namespace for SLSB#2

       +- ejb (class: org.jnp.interfaces.NamingContext)
       | +- MyStatless-RemoteInvoker (class: org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA)
       | +- MyStatless-HomeInvoker (class: org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxyHA)
       | +- MyStatless (proxy: $Proxy64 implements interface it.csi.oss.clusterejb.interfaces.MyStatlessHome,interface javax.ejb.Handle)
      


      Code snipit for SLSB#1 :

       InitialContext ic1;
       MyStatlessHome home=null;
       try {
       ic1 = new InitialContext();
       String contextFactory = (String) ic1.lookup("java:comp/env/contextFactory");
       String urlMyStatless = (String) ic1.lookup("java:comp/env/urlMyStatless");
       String jndiMyStatless = (String) ic1.lookup("java:comp/env/jndiMyStatless");
       Properties env =new Properties();
       env.setProperty(Context.INITIAL_CONTEXT_FACTORY,contextFactory);
       env.setProperty(Context.PROVIDER_URL,urlMyStatless);
       System.out.println("+++++++ @ Sono MyStalessClient Iniziato lookup : contextFacry ="+ env.getProperty(Context.INITIAL_CONTEXT_FACTORY)+" url = "+ env.getProperty(Context.PROVIDER_URL) );
       InitialContext ic = new InitialContext(env);
       Object objRef = ic.lookup(jndiMyStatless);
       home = (MyStatlessHome)PortableRemoteObject.narrow(
       objRef, MyStatlessHome.class);
       } catch (NamingException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
      
      


      ejb-jar.xml for SLSB#1 :
       <session >
       <description><Description for MyStatlessClient]]></description>
       <display-name>Name for MyStatlessClient</display-name>
      
       <ejb-name>MyStatlessClient</ejb-name>
      
       <home>it.csi.oss.clusterejb.interfaces.MyStatlessClientHome</home>
       <remote>it.csi.oss.clusterejb.interfaces.MyStatlessClient</remote>
       <ejb-class>it.csi.oss.clusterejb.ejb.MyStatlessClientSession</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       <env-entry>
       <env-entry-name>contextFactory</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value><![CDATA[org.jnp.interfaces.NamingContextFactory]]></env-entry-value>
       </env-entry>
       <env-entry>
       <env-entry-name>urlMyStatless</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value><![CDATA[jnp://cst003.csi.it:1200]]></env-entry-value>
       </env-entry>
       <env-entry>
       <env-entry-name>jndiMyStatless</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value><![CDATA[ejb/MyStatless]]></env-entry-value>
       </env-entry>
      
       </session>
      



      StackTrace on context.lookup() :

      2006-05-04 12:48:35,746 INFO [STDOUT] javax.naming.NameNotFoundException: ejb/MyStatless
      2006-05-04 12:48:35,746 INFO [STDOUT] at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:223)
      2006-05-04 12:48:35,747 INFO [STDOUT] at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:134)
      2006-05-04 12:48:35,747 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2006-05-04 12:48:35,747 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2006-05-04 12:48:35,747 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-05-04 12:48:35,747 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
      2006-05-04 12:48:35,747 INFO [STDOUT] at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:229)
      2006-05-04 12:48:35,747 INFO [STDOUT] at $Proxy84.lookup(Unknown Source)
      2006-05-04 12:48:35,747 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      2006-05-04 12:48:35,747 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      2006-05-04 12:48:35,747 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      ..
      ..
      ..
      

      -Thanks