This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
OS=Windows98, Tomcat v. 4.1.27.exe, J2SE/JDK v. 1.3.1 contents of AUTOEXEC.BAT: set PATH=c:\jdk1.3.1\bin;%PATH% set CLASSPATH=%CLASSPATH%;.;c:\ServletDevel;c:\Tomcat\common\lib\servlet.jar set JAVA_HOME=c:\jdk1.3.1 location of NamingService: class sl314.util.NamingService development directory path of InitializeConnectionPool.java: c:\ServletDevel\database\src\web\
development directory path of NamingService.java: c:\ServletDevel\database\src\util\
I tried to compile InitializeConnectionPool.java, by doing this: c:\ServletDevel\database\src\web\javac InitializeConnectionPool.java but compilation errors below occured: InitializeConnectionPool.java:72: cannot resolve symbol symbol: class NamingService location: class sl314.web.InitializeConnectionPool NamingService nameSvc = NamingService.getInstance(); ^ InitializeConnectionPool.java:72: cannot resolve symbol symbol: variable NamingService location: class sl314.web.InitializeConnectionPool NamingService nameSvc = NamingService.getInstance(); ^ InitializeConnectionPool.java:75: cannot resolve symbol symbol: class ConnectionPool location: class sl314.web.InitializeConnectionPool ConnectionPool connectionPool ^ InitializeConnectionPool.java:76: cannot resolve symbol symbol: class ConnectionPool location: class sl314.web.InitializeConnectionPool (ConnectionPool) nameSvc.getAttribute("connectionPool"); ^ Actually 10 errors.
Is anybody there can help? What do errors above mean? What should I do to successfully compile InitializeConnectionPool.java? Any suggestion would be greatly appreciated.
Hi, is there some thing like below appearing in u r java file 1)import database.src.web.*; 2)import database.src.util.*; ??? if these lines r missing ,try with it cheers Praful
All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Joined: Oct 22, 2003
Praful, Thank you for your reply. Below is included in InitializeConnectionPool.java: package sl314.web; // Servlet imports import javax.servlet.ServletContextListener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContext; // SQL Utility Imports import sl314.util.NamingService; import sl314.util.sql.ConnectionPool; import java.sql.SQLException; ...but still compilation errors occured. Maybe something's wrong with the codes or with the compiler. If you have suggestions regarding this, please post it.
Cathy [ October 23, 2003: Message edited by: Cathy VM ]
How about changing you classpath environment variable from:
Also verify that the .class and not just the source.java files are located there. Because I noticed the "src" as part of your path. c:\ServletDevel\database\src\util\sl314\util\NamingService.class c:\ServletDevel\database\src\util\sl314\util\sql\ConnectionPool.class If not you must modify your classpath variable to point those class files. Craig
Joined: Oct 22, 2003
Craig, Thank you for suggestions.
I've changed the classpath environment from: CLASSPATH%;.;c:\ServletDevel;c:\Tomcat\common\lib\servlet.jar to: CLASSPATH%;.;c:\ServletDevel\database\sl314\util\;c:\Tomcat\common\lib\servlet.jar
I've also changed the development directory path for NamingService.class from: c:\ServletDevel\database\src\util\
and NamingService.class is located there. Now I know what the problem is, I do not have the ConnectionPool.class file which should be located at the directory path below: c:\ServletDevel\database\sl314\util\sql\ I am new with servlets, I don't know how to have that ConnectionPool.class. Actually, I only want this example web application integrated with database to run in my PC, as a start of learning servlets with database. Do i have to install something about ConnectionPool in my PC just to have that ConnectionPool.class? Or should I build the ConnectionPool? If so, how will I do it? Any information regarding this from anybody would be great appreciated.
Thanks in advance. Cathy [ October 23, 2003: Message edited by: Cathy VM ]