Vish
2003-11-07 21:00:57 UTC
I am getting the following exception javax.naming.NoInitialContextException: Cannot
instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException:
weblogic/jndi/WLInitialContextFactory]
Peoplesoft application is customized to run a java program and this program is
trying to do Initial context and I am getting the above exception. Peoplesoft
application server has Weblogic 6.1 SP4 and /classes directory has weblogic.jar
file. Strangest thing is that when I load this class using Class.forName it works
fine but it is giving exception with InitialContext(properties).
try
{
c = Class.forName("weblogic.jndi.WLInitialContextFactory");
}
catch (ClassNotFoundException e)
{
System.out.println("ClassNotFoundException:" + e.toString());
}
catch (Exception e)
{
System.out.println("Exception:" + e.toString());
}
System.out.println("----Class name:" + c.getName() );
Above code works fine. I get the class name correctly which is given below.
----Class name:weblogic.jndi.WLInitialContextFactory
Following code is throwing an exception which is listed at the top.
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url +":" + port);
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
try
{
this.initialContext = new InitialContext(properties);
}
catch (NoInitialContextException e)
{
System.out.println("NoInitialContextException:" + e.toString());
}
catch (NamingException e)
{
System.out.println("NamingException:" + e.toString());
}
catch (Exception e)
{
System.out.println("Exception:" + e.toString());
}
Any ideas on this is appreciated.
Vish
instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException:
weblogic/jndi/WLInitialContextFactory]
Peoplesoft application is customized to run a java program and this program is
trying to do Initial context and I am getting the above exception. Peoplesoft
application server has Weblogic 6.1 SP4 and /classes directory has weblogic.jar
file. Strangest thing is that when I load this class using Class.forName it works
fine but it is giving exception with InitialContext(properties).
try
{
c = Class.forName("weblogic.jndi.WLInitialContextFactory");
}
catch (ClassNotFoundException e)
{
System.out.println("ClassNotFoundException:" + e.toString());
}
catch (Exception e)
{
System.out.println("Exception:" + e.toString());
}
System.out.println("----Class name:" + c.getName() );
Above code works fine. I get the class name correctly which is given below.
----Class name:weblogic.jndi.WLInitialContextFactory
Following code is throwing an exception which is listed at the top.
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url +":" + port);
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
try
{
this.initialContext = new InitialContext(properties);
}
catch (NoInitialContextException e)
{
System.out.println("NoInitialContextException:" + e.toString());
}
catch (NamingException e)
{
System.out.println("NamingException:" + e.toString());
}
catch (Exception e)
{
System.out.println("Exception:" + e.toString());
}
Any ideas on this is appreciated.
Vish