Discussions

EJB programming & troubleshooting: Setting up JNDI tree

  1. Setting up JNDI tree (6 messages)

    Hi ,

    My webserver is java webserver 2.0 and application server is weblogic 5.1 . web server and weblogic server resides in two different machine . What JNDI setup is required to lookup a home interface from a servlet in JWS 2.0

    thanks in advance

    Ashim Chakraborty

    Threaded Messages (6)

  2. Setting up JNDI tree[ Go to top ]

     Properties p=new Properties();
     p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
     p.put(Context.PROVIDER_URL,"t3://localhost:7001");

    Context ctx = new InitialContext(p);
    AccountHome1 home =
    (AccountHome1) ctx.lookup("AccountHome");

    Instead of localhost use the machines ip address or name of that machine from ur servlet which is residing in ur javawebserver.
    bye
    -kiran
  3. Setting up JNDI tree[ Go to top ]

    Thanks kiran ,

       but it is not working . what i have tried is


    import javax.naming.*;
    import java.util.*;

    public class testJndi
    {

       public static void main( String args[]) throws Exception
       {
           Properties p=new Properties();
           p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
           p.put(Context.PROVIDER_URL,"t3://80.0.0.12:7001");
           Context ctx = new InitialContext(p);
           System.out.println(ctx);
       }
    }

       giving exception cann't instantiate weblogic.jndi.TengahInitialContextFactory nested exception is java.lang.ClassNotFound exception
  4. Setting up JNDI tree[ Go to top ]

    Try this instead of the Tengah class name

    "weblogic.jndi.WLInitialContextFactory"
  5. Setting up JNDI tree[ Go to top ]

    Thanks Monica ,

        but the same problem is still there

        Pls help me out
  6. Setting up JNDI tree[ Go to top ]

    Could u post the error that it throws?
    Sahil
  7. Setting up JNDI tree[ Go to top ]

    put the Weblogic.InitialContextFactory in our classpath. It will be in weblogic classes. Take it and put it in the machine where your webserver resides.. in classpath.

    regards,
    Koshy