Hi
I am trying to obtain the JNDI handle for the dbcp.
I am using jdk 1.5, jre/lib/ext is in classpath, using eclipse IDE.
I do not know much about JNDI. I picked up a program from commons
website and tried it:
/**************CODE SNIPPET STARTS************************/
public class JNDI4ConnectionPool {
public static void main(String args[]) {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
System.setProperty(Context.PROVIDER_URL,
"file:///home/kmaheshw/tmp");
InitialContext ic = null;
.......
/*****************CODE SNIPPET ENDS*****************************/
I get following runtime error:
javax.naming.NoInitialContextException: Cannot instantiate class:
com.sun.jndi.fscontext.RefFSContextFactory [Root exception is
java.lang.ClassNotFoundException:
com.sun.jndi.fscontext.RefFSContextFactory]
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at extra.JNDI4ConnectionPool.main(JNDI4ConnectionPool.java:21)
Any clue whats going on?
Basically, I want to use dbcp as connection pool for a Glassfish JPA
application and hence i need to create a jndi location.
Am i on correct path?
Regards
k.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]