David, I think I am a little confused. Someone else on this list suggested that I go back to my JDBC driver vendor, and/or my JSP/Servlet vendor and find out what jar file their implementation of JNDI was located in, and to get advice on how to set properties and obtain a new Initial Context. I did get a reply from my JDBC vendor, who indicated that their sample file used the com.sun.jndi.fscontext.RefFSContextFactory by default, since this was included in the Sun JDK. Since I could not get either the Java class or my Servlet file working, I suspect that I don't have something set up on my dev box properly, perhaps the fscontext jar file, as you suggested. But my intent is to actually use JNDI in a servlet. My driver vendor suggested that if I wanted to use JNDI inside my JSP/servlet server environment, I would need to contact the vendor of my servlet server (Allaire in this case) and find out what jar file and API they had for setting properties and creating a new Initial Context. I am still waiting to here back from Allaire. Am I on the right track here, or am I completely missing something???
Thanks in advance for your advice/input. Celeste -----Original Message----- From: David M. Karr [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: Re: Using JNDI in a JSP/Servlet >>>>> "Celeste" == Celeste Haseltine <Haseltine> writes: Celeste> I'm attempting to use JNDI with a third party JDBC driver inside of a Celeste> servlet. When I attempt to call the servlet, my catch block catches the Celeste> following error message: Celeste> Error ..... Cannot instantiate class: Celeste> com.sun.jndi.fscontext.RefFSContextFactory Celeste> I moved the code into a pure Java class for debugging. The line that the Celeste> error message occurs on is as follows: Celeste> ctx = new InitialContext(env); Celeste> Does anyone have a guess as to why I am unable to instantiate a new Context Celeste> class? I suspect it may have to do with setting permissions for jndi, but I Celeste> am not certain. I do have the JNDI.jar file in my server jvm jre\lib\ext Celeste> subdirectory, and I moved it into my jdk jre\lib\ext subdirectory for Celeste> debugging the class code. Just for grins I included the jdk jre\lib\ext Celeste> path in my dev box classpath for testing the class code. The class code is Celeste> as follows: Ordinarily, I would assume this is a silly question, but did you make the jar file which contains the "com.sun.jndi.fscontext.RefFSContextFactory" class available to the application? This particular class (as I recognize it) should be in the "fscontext.jar" that is part of the "File System" sample JNDI service provider that you can get from <http://java.sun.com/products/jndi/serviceproviders.html>. -- =================================================================== David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; BrainBench CJ12P (#12004) =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com