JNDI InitialContext problem
I get the error message:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory. Root exception is java.lang.ClassNotFoundException
I'm guessing the error is arising from:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/MySQL");
I put the path to j2ee.jar in $J2EE_CLASSPATH and $CLASSPATH, still no luck. Can anyone help me out?
I'm just fiddling around with a basic command line program, not using servlets/jsps so i didn't think web.xml should matter? And I added the datasource using j2eeadmin -addJdbcDataSource, and now i run j2ee -verbose it prints (amoung other things)
Binding DataSource, name = jdbc/MySQL, url = jdbc://Myserv:3306/test
so i figure that's ok.
just noticed i left a bit of the end of the error message (whoops) full message is
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory. Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
From the error, I would be led to believe that your program, whatever it is, is having problems finding the Sun Initial Context Factory class. Is that class available in the classpath?