Hi, It's fairly simple, I think: you need to import a few more things. Add import statements for javax.naming.InitialContext, javax.sql.DataSource, java.sql.Connection... and see what happens ;)
Yoav Shapira Millennium ChemInformatics -----Original Message----- From: Eddie Liang [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 10:11 AM To: 'Tomcat Users List' Subject: JNDI; InitialContext not found? Hi, � I use jsp to invoke a Context, but Tomcat give a error message: org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred between lines: 13 and 25 in the jsp file: /JSP/com/imedge/admin/testfam.jsp Generated servlet error: C:\Tomcat 4.0\work\Standalone\localhost\_\JSP\com\imedge\admin\testfam$jsp.java:65: Class org.apache.jsp.InitialContext not found. ��������������������������� Context ctx = new InitialContext(); ������������������������������������������� ^ An error occurred between lines: 13 and 25 in the jsp file: /JSP/com/imedge/admin/testfam.jsp Generated servlet error: C:\Tomcat 4.0\work\Standalone\localhost\_\JSP\com\imedge\admin\testfam$jsp.java:69: Class org.apache.jsp.DataSource not found. ����������������������������� DataSource ds = (DataSource) envCtx.lookup("jdbc/ImedgeDB"); ����������������������������� ^ An error occurred between lines: 13 and 25 in the jsp file: /JSP/com/imedge/admin/testfam.jsp Generated servlet error: C:\Tomcat 4.0\work\Standalone\localhost\_\JSP\com\imedge\admin\testfam$jsp.java:69: Class org.apache.jsp.DataSource not found. ����������������������������� DataSource ds = (DataSource) envCtx.lookup("jdbc/ImedgeDB"); ���������������������������������������������� ^ An error occurred between lines: 13 and 25 in the jsp file: /JSP/com/imedge/admin/testfam.jsp Generated servlet error: C:\Tomcat 4.0\work\Standalone\localhost\_\JSP\com\imedge\admin\testfam$jsp.java:73: Class org.apache.jsp.Connection not found. ������������������������������������� Connection conn = ds.getConnection(); ������������������������������������� ^ My jsp file is : <%@ page import = "com.imedge.admin.testImedge" %> <html> <body> <table� width="100%" height="100%" cellpadding="0" cellspacing="0"> ������� <tr > ������� ������� <td� class="leftFrame" bgcolor="beige" color="black" valign="top" width=180 > ������� ������� � ������� ������� �� <h4> <img align="absmiddle" src="/JSP/com/imedge/admin/images/familysmall.gif" > Family </h4> <%@ page import="javax.naming.Context" %> ������� <% ����������� Context ctx = new InitialContext(); ������������� if (ctx ==null) ��������������� throw new Exception("Oh my God - No context"); ������������ Context envCtx = (Context) ctx.lookup("java:comp/env"); ������������� DataSource ds = (DataSource) envCtx.lookup("jdbc/ImedgeDB"); ������� ������� out.print("DataSource " + ds); �������������� if( ds != null) ��������������� { ��������������������� Connection conn = ds.getConnection(); ��������������� } �%> </body> � My server.xml and web.xml is in the attachments. Does anyone know what is wrong here?� Or do I miss anything? Thank you very much. <<server.xml>> <<web.xml>> ���� Eddie Liang Database Architect Phone: 630-297-1229 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
