You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Francesco Corbetta <fr...@pleiade.it> on 2003/08/25 13:05:59 UTC
DBCP and JNDI
Hi
I'm trying to write a Web Service which connects to a Mysql Server using the Tomcat DBCP.
I've modified server.xml of tomcat and web.xml of axis as explained in the "jndi datasource how-to"
I also copied the servlet and the test page of this Howto in the axis application directory and all
works fine. Then i'm trying to obtain a connection in the service but i obtain a
javax.naming.NoInitialContextException: Need to specify class name in environment or system
property, or as an applet parameter, or in an application resource file:
java.naming.factory.initial
.......
It seems that the service cannot access the JNDI. In fact it is enough to have the following lines
in the service:
try{
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
}catch(Exception e) {
e.printStackTrace();
}
to get the error.
Any idea?
Thanks in advance
Francesco