• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

failed to compile servlet file

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Regards,
Cathy
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Cathy Valdez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about changing you classpath environment variable from:

to

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
 
Cathy Valdez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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\

to:
c:\ServletDevel\database\sl314\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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic