3 Replies Latest reply on Feb 24, 2006 2:01 AM by starksm64

    a question about fault tolerance during DIY Jboss JNDI

    niklaus_wirth2000

      Hi, I have a question about fault tolerance during DIY Jboss JNDI.
      I have developed lots of applications with WebLogic, which is powerful in fault tolerance. For example, having defined a data source named ?jdbc/myDB? in JNDI, I can execute lookup in follow way without add prefix such as ?java:/? or ?java:comp/env/?.

      Context ctx = new InitialContext();
       DataSource ds = (DataSource) ctx.lookup(?jdbc/myDB?) ;

      I feel it brings developers convenience and looks more reasonable. Having researched source files in package ?jboss.naming.interface?, I?d like to DIY Jboss to add such a character. My point is to add fault tolerance code in NamingContext.lookup() but failed.
      public Object lookup (String name)
       throws NamingException
       {
       if(name.startsWith("java:")==false){
       name = "java:/"+name;
       }
      
       return lookup (getNameParser (name).parse (name));
       }


      I always got NameNotFoundException because the namespace I got is Global JNDI Namespace instead of java: Namespace. Does anybody know how to solve it? Any help is appreciated.