dkim18
asked on
Already set weblogic.jar in the classpath, but "cannot instantiate class: weblogic.jndi.WLInitialContextFactory" error.
Hi,
I have set weblogic.jar in classpath, but still having this error.
Error NamingException: Cannot instantiate class: weblogic.jndi.WLInitialCon textFactor y
This is part of code:
+++++++++++++++++++++++++
public void PrintStudentInfo(){
Context initcntx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CON TEXT_FACTO RY, "weblogic.jndi.WLInitialCo ntextFacto ry");
ht.put(Context.PROVIDER_UR L, "t3://localhost:7001");
ht.put(Context.SECURITY_PR INCIPAL, "userId");
ht.put(Context.SECURITY_CR EDENTIALS, "password");
BTW, this is just java program.
thanks,
I have set weblogic.jar in classpath, but still having this error.
Error NamingException: Cannot instantiate class: weblogic.jndi.WLInitialCon
This is part of code:
+++++++++++++++++++++++++
public void PrintStudentInfo(){
Context initcntx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CON
ht.put(Context.PROVIDER_UR
ht.put(Context.SECURITY_PR
ht.put(Context.SECURITY_CR
BTW, this is just java program.
thanks,
ASKER
javax.naming.NoInitialCont extExcepti on: Cannot instantiate class: weblogic.jndi.WLInitialCon textFactor y [Root exception is java.lang.ClassNotFoundExc eption: weblogic.jndi.WLInitialCon textFactor y]
at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:652)
at javax.naming.InitialContex t.getDefau ltInitCtx( InitialCon text.java: 243)
at javax.naming.InitialContex t.init(Ini tialContex t.java:219 )
at javax.naming.InitialContex t.<init>(I nitialCont ext.java:1 95)
at PrintStudentInfoFromPool.P rintStuden tInfo(Prin tStudentIn foFromPool .java:30)
at PrintStudentInfoFromPool.m ain(PrintS tudentInfo FromPool.j ava:66)
Caused by: java.lang.ClassNotFoundExc eption: weblogic.jndi.WLInitialCon textFactor y
at java.net.URLClassLoader$1. run(URLCla ssLoader.j ava:199)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
at java.net.URLClassLoader.fi ndClass(UR LClassLoad er.java:18 7)
at java.lang.ClassLoader.load Class(Clas sLoader.ja va:289)
at sun.misc.Launcher$AppClass Loader.loa dClass(Lau ncher.java :274)
at java.lang.ClassLoader.load Class(Clas sLoader.ja va:235)
at java.lang.ClassLoader.load ClassInter nal(ClassL oader.java :302)
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:2 19)
at com.sun.naming.internal.Ve rsionHelpe r12.loadCl ass(Versio nHelper12. java:42)
at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:649)
... 5 more
java.lang.NullPointerExcep tion
at PrintStudentInfoFromPool.P rintStuden tInfo(Prin tStudentIn foFromPool .java:58)
at PrintStudentInfoFromPool.m ain(PrintS tudentInfo FromPool.j ava:66)
at javax.naming.spi.NamingMan
at javax.naming.InitialContex
at javax.naming.InitialContex
at javax.naming.InitialContex
at PrintStudentInfoFromPool.P
at PrintStudentInfoFromPool.m
Caused by: java.lang.ClassNotFoundExc
at java.net.URLClassLoader$1.
at java.security.AccessContro
at java.net.URLClassLoader.fi
at java.lang.ClassLoader.load
at sun.misc.Launcher$AppClass
at java.lang.ClassLoader.load
at java.lang.ClassLoader.load
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
at com.sun.naming.internal.Ve
at javax.naming.spi.NamingMan
... 5 more
java.lang.NullPointerExcep
at PrintStudentInfoFromPool.P
at PrintStudentInfoFromPool.m
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try displaying the full stack trace