Getting error message Cannot Resolve Symbol when trying to compile a class

Hello All -
I am getting an error message cannot resolve symbol while trying to compile a java class that calls another java class in the same package. The called class compiles fine, but the calling class generates
the following error message:
D:\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes\cal>javac
ConnectionPool.java
ConnectionPool.java:158: cannot resolve symbol
symbol : class PooledConnection
location: class cal.ConnectionPool
private void addConnection(PooledConnection value) {
^
ConnectionPool.java:144: cannot resolve symbol
symbol : class PooledConnection
location: class cal.ConnectionPool
PooledConnection pcon = new PooledConnection(con);
^
ConnectionPool.java:144: cannot resolve symbol
symbol : class PooledConnection
location: class cal.ConnectionPool
PooledConnection pcon = new PooledConnection(con);
The code is listed as follows for PooledConnection.java (it compiles fine)
package cal;
import java.sql.*;
public class PooledConnection {
// Real JDBC Connection
private Connection connection = null;
// boolean flag used to determine if connection is in use
private boolean inuse = false;
// Constructor that takes the passed in JDBC Connection
// and stores it in the connection attribute.
public PooledConnection(Connection value) {
if ( value != null ) {
connection = value;
// Returns a reference to the JDBC Connection
public Connection getConnection() {
// get the JDBC Connection
return connection;
// Set the status of the PooledConnection.
public void setInUse(boolean value) {
inuse = value;
// Returns the current status of the PooledConnection.
public boolean inUse() {
return inuse;
// Close the real JDBC Connection
public void close() {
try {
connection.close();
catch (SQLException sqle) {
System.err.println(sqle.getMessage());
Now the code for ConnectionPool.java class that gives the cannot
resolve symbol error
package cal;
import java.sql.*;
import java.util.*;
public class ConnectionPool {
// JDBC Driver Name
private String driver = null;
// URL of database
private String url = null;
// Initial number of connections.
private int size = 0;
// Username
private String username = new String("");
// Password
private String password = new String("");
// Vector of JDBC Connections
private Vector pool = null;
public ConnectionPool() {
// Set the value of the JDBC Driver
public void setDriver(String value) {
if ( value != null ) {
driver = value;
// Get the value of the JDBC Driver
public String getDriver() {
return driver;
// Set the URL Pointing to the Datasource
public void setURL(String value ) {
if ( value != null ) {
url = value;
// Get the URL Pointing to the Datasource
public String getURL() {
return url;
// Set the initial number of connections
public void setSize(int value) {
if ( value > 1 ) {
size = value;
// Get the initial number of connections
public int getSize() {
return size;
// Set the username
public void setUsername(String value) {
if ( value != null ) {
username = value;
// Get the username
public String getUserName() {
return username;
// Set the password
public void setPassword(String value) {
if ( value != null ) {
password = value;
// Get the password
public String getPassword() {
return password;
// Creates and returns a connection
private Connection createConnection() throws Exception {
Connection con = null;
// Create a Connection
con = DriverManager.getConnection(url,
username, password);
return con;
// Initialize the pool
public synchronized void initializePool() throws Exception {
// Check our initial values
if ( driver == null ) {
throw new Exception("No Driver Name Specified!");
if ( url == null ) {
throw new Exception("No URL Specified!");
if ( size < 1 ) {
throw new Exception("Pool size is less than 1!");
// Create the Connections
try {
// Load the Driver class file
Class.forName(driver);
// Create Connections based on the size member
for ( int x = 0; x < size; x++ ) {
Connection con = createConnection();
if ( con != null ) {
// Create a PooledConnection to encapsulate the
// real JDBC Connection
PooledConnection pcon = new PooledConnection(con);
// Add the Connection to the pool.
addConnection(pcon);
catch (Exception e) {
System.err.println(e.getMessage());
throw new Exception(e.getMessage());
// Adds the PooledConnection to the pool
private void addConnection(PooledConnection value) {
// If the pool is null, create a new vector
// with the initial size of "size"
if ( pool == null ) {
pool = new Vector(size);
// Add the PooledConnection Object to the vector
pool.addElement(value);
public synchronized void releaseConnection(Connection con) {
// find the PooledConnection Object
for ( int x = 0; x < pool.size(); x++ ) {
PooledConnection pcon =
(PooledConnection)pool.elementAt(x);
// Check for correct Connection
if ( pcon.getConnection() == con ) {
System.err.println("Releasing Connection " + x);
// Set its inuse attribute to false, which
// releases it for use
pcon.setInUse(false);
break;
// Find an available connection
public synchronized Connection getConnection()
throws Exception {
PooledConnection pcon = null;
// find a connection not in use
for ( int x = 0; x < pool.size(); x++ ) {
pcon = (PooledConnection)pool.elementAt(x);
// Check to see if the Connection is in use
if ( pcon.inUse() == false ) {
// Mark it as in use
pcon.setInUse(true);
// return the JDBC Connection stored in the
// PooledConnection object
return pcon.getConnection();
// Could not find a free connection,
// create and add a new one
try {
// Create a new JDBC Connection
Connection con = createConnection();
// Create a new PooledConnection, passing it the JDBC
// Connection
pcon = new PooledConnection(con);
// Mark the connection as in use
pcon.setInUse(true);
// Add the new PooledConnection object to the pool
pool.addElement(pcon);
catch (Exception e) {
System.err.println(e.getMessage());
throw new Exception(e.getMessage());
// return the new Connection
return pcon.getConnection();
// When shutting down the pool, you need to first empty it.
public synchronized void emptyPool() {
// Iterate over the entire pool closing the
// JDBC Connections.
for ( int x = 0; x < pool.size(); x++ ) {
System.err.println("Closing JDBC Connection " + x);
PooledConnection pcon =
(PooledConnection)pool.elementAt(x);
// If the PooledConnection is not in use, close it
if ( pcon.inUse() == false ) {
pcon.close();
else {
// If it is still in use, sleep for 30 seconds and
// force close.
try {
java.lang.Thread.sleep(30000);
pcon.close();
catch (InterruptedException ie) {
System.err.println(ie.getMessage());
I am using Sun JDK Version 1.3.0_02" and Apache/Tomcat 4.0. Both the calling and the called class are in the same directory.
Any help would be greatly appreciated.
tnx..
addi

Is ConnectionPool in this "cal" package as well as PooledConnection? From the directory you are compiling from it appears that it is. If it is, then you are compiling it incorrectly. To compile ConnectionPool (and PooledConnection similarly), you must change the current directory to the one that contains cal and type
javac cal/ConnectionPool.

Similar Messages

  • I KEEP GETTING ERROR MESSAGES 403 AND 404 WHEN TRYING TO SEARCH FROM FIREFOX..HOW COME

    when I bring up firefox it is usually to get into my mail...if I try to search for something thru google /yahoo I get error messages 403 or 404 ...

    ''SusanR62 [[#answer-722913|said]]''
    <blockquote>
    The only system I can get the video to work is Chrome.
    </blockquote>
    This is because Chrome does not use Adobe Flash Player. Chrome uses something called Pepper Flash, maintained by Google (not Adobe). The issues you are experiencing are Adobe Flash Player issues. You should be able to get assistance with these issues [https://forums.adobe.com/community/flashplayer/using_flashplayer on the Adobe forums].

  • Getting error message "Unable to Share" when trying to send pictures either by text or emai!  Is there something in my security settings that I need to change?

    I am unable to send pictures either by text or email. I will get an error message that states "Unable to Share".  Just purchased the iPhone 6 plus. Never had this issue with the 5.  Is there something that I need to change in my settings?

    I am unable to send pictures either by text or email. I will get an error message that states "Unable to Share".  Just purchased the iPhone 6 plus. Never had this issue with the 5.  Is there something that I need to change in my settings?

  • Why do I keep getting error message from Digital Editions when trying to open it. Keeps telling me that it has encountered a problem and needs to close. I need this apparently to download a text book fro Proquest - need the text book for Uni work what giv

    Why do I keep getting an error message from Digital Editions saying that it has encountered a problem and needs to close. I need this programme to download a text book from Proquest for University work what gives????

    You are using ADE on Windows or Mac ? and their versions ??
    Please restart your machine and try once again.
    Thanks

  • I keep getting error message " server stopped responding" when trying to connect to internet via wifi

    My iphone works fine using cellar network, but will not connect to internet via wifi. Ive reset network setting with no diffrence.
    Any ideas?

    And you can turn the WiFi button on and off?
    If yes, then you next need to try to Restore your iPhone from your backup.

  • Keep getting error message appication not found when trying to use Firefox, recently had lightning strike neighborhood box.

    also will not load automatically anymore since lost power few days ago.

    Same issue to with Windows XP SP3 x86 with Java Runtime Enviornment 1.5.0_15
    J2SE Enviornment 5.0 Update 15
    Java 6 Update 17

  • Cannot boot my MacBook Pro. Tryed CMD+R, reinstall OS, error message :damaged HD. When trying to repait it says it's OK. Yesterday HD wasn't even half full when I turned it off, now it says it's full.

    Cannot boot my MacBook Pro. Tryed CMD+R, reinstall OS, error message :damaged HD. When trying to repait it says it's OK. Yesterday HD wasn't even half full when I turned it off, now it says it's full.

    What may have happened is an error and a kernel panic, filling up the logfiles.
    What I recommend is first to find a way to backup your data without booting the hard drive directly if it isn't already backed up, and then get Alsoft Disk Warrior to repair the hard drive.    You'll probably want an external drive from http://www.macsales.com/
    And you'll want to go into Hard drive -> Library -> Logs, System -> Library -> Logs, and Users -> yourname -> Library -> Logs to remove whatever you find there.   
    If after booting it fills up again, start by removing all startup items in your System Preferences for your user, and rebooting in safe mode with the shift key held down. If the hard drive is over 85% full after removing the logfiles, you may want to look at what were the last applications you installed.
    Peer2peer software if installed can be as bad as a virus, because it enables others to access your computer. Insecure wireless networks are just as bad, if they are WEP or no encryption and someone is within 1500 feet of your computer.
    If no such software is installed, your RAM probably has failed.    Run the hardware test that came with your computer, by booting with the 'D' key.
    If nothing shows up there, it can still be the RAM.   Especially if you've seen any 4 language screens telling you to restart.
    Here's more on kernel panics:
    http://www.macmaps.com/kernelpanic.html*

  • I'm trying to make a cd from my itunes. I get error message "cannot be used because it is not recognized.

    I'm trying to make a cd from my itunes. I get error message "cannot be used because it is not recognized.

    I just figured it out. All I had to do was close out of iTunes then restart.

  • I'm trying to burn a dvd from idvd but I keep getting error message, broken assets, but when I check my drop zones and their content there's no error messages on any of them?

    I'm trying to burn a dvd from idvd but I keep getting error message, broken assets, but when I check my drop zones and their content there's no error messages on any of them?

    Hi
    And if You change view - in main "window/view field" so that You see the box-plot structure.
    No exclamation marks there either ?
    and non at the front page ?
    iDVD do not copy Your material - only points to where it is stored. So if on any external hard disks, USB-memories, CDs or DVDs are missing - assetts are broken.
    Or if You changed location of any material or directed iPhoto or iTunes or GarageBand to a new Library - Then iMovie/iDVD also get's lost.
    Yours Bengt W

  • HT201210 iam getting a error message code of 3194 when trying to restore iphone 4 on itunes

    iam getting a error message code of 3194 when trying to restore iphone 4 on itunes

    http://support.apple.com/kb/TS3694

  • TS1718 I tried to update, did not work, unintstalled did not work.  Now when I try to install i get error message "The feature you are trying to use is on a network resource tha is unabailable.  Looking for itunes64.msi path.

    I tried to update, did not work, unintstalled did not work.  Now when I try to install i get error message "The feature you are trying to use is on a network resource tha is unabailable.  Looking for itunes64.msi path.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Cannot resolve symbol when the classes are in the same package

    i have one interface and two classes all in the same package. am getting " cannot resolve symbol", when the code refers to the interface or the class .
    the package name is collections.impl and
    the directory i used to store all the java files:
    c:\jdk\bin\collections\impl.
    isthere any othe option other than compiling all the files from the comand line at the same time?
    please help - i m new to java.

    If you have:
    I.java:
    package some;
    public interface I {
        void method();
    }A.java:
    package some;
    public class A implements I {
        public void method() {
            new B();
    }B.java:
    package some;
    public class B implements I {
        public void method() {
            new A();
    }in c:/temp/some for example
    you can compile your files with
    javac c:/temp/some/*.java
    It seems that you have errors in your code.
    Recheck it twice or use NetBeans IDE(http://www.netbeans.org) it will do this for you ;)

  • HT1657 Downloaded rush yesterday on my iPad2 - went to watch it today. 1.23 seconds in I get error message "cannot load video" Most annoying! Not happened before. Please ether fix or give me my money back

    Downloaded "Rush" yesterday on my iPad2 - sat down to watch it today. 1.23 seconds in, I get error message "cannot load video" Most annoying! Not happened before. Please ether fix or give me my money back asap
    Jody

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple.
    What have you tried to fix it ? Have you tried closing the Videos app via the iPad's multitasking bar and seeing if it plays properly when you re-open then app ? Have you tried a soft-reset of your iPad ? If neither of those fix it then are you in a country where films can be redownloaded (assuming that it's not a rental) ? If you are then delete it from the Videos app and redownload it via the Purchased tab in the iTunes store app.
    If you can't redownload it (e.g. if it's a rental) then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Getting error message "cannot sign in due to server error"

    Why am I getting error message "cannot sign in due to server error" when I try to sign in to iCloud?

    A software fluke or hiccup perhaps. Try closing the mail app completely, reboot the iPad and see if the message goes away.
    Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the Mail app and then swipe "up" on the app preview thumbnail to close it.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Why do I keep getting a message "insert blank disk" when trying to burn playlist to cd?

    Why do I keep getting a message "insert blank disk" when trying to burn playlist to cd? I can import burned cds to iTunes just fine, but cannot burn playlist to disk.

    because you have to be using a blank cd-rw or cd-r.

Maybe you are looking for

  • Creative Cloud for teams - a problem with the license.

    Hi, I bought on 25.04.2013 CC licenses for teams (for 12 months). In my account (in subscriptions) I can see the end date 02/06/2014 (only 9 months). According to the license shall be for 12 months to 24/04/2014. Why? Regards

  • How to setup the local testing server ??

    hello, what do I need to install first before I can setup the testing server in dreamweaver 8? I have download apache2 triad, mySQL, IIS 6... Where should I download the correct version of mySQL because I need to test my php scripts locally which has

  • Album view and Cover Flow problem

    Well, im going to get one of the new ipods soon and they have that Cover Flow feature which is pretty cool. Anyway i have a problem, when i try and sort them by album, i go to Album View and even if the album names are the same, they arnt in the same

  • Passing Data to the Purchase Order Style Sheet

    I am new to oracle so please pardon my ignorance. I was tasked with switching the Purchase Order from transmitting via a 3rd party application to using XML Publisher. I was able to get the PO to generate successfully and I have made a few minor chang

  • Migration from 10g to 12c using data pump

    hi there, while I've used data pump at the schema level before, I'm rather new at full database imports. we are attempting a full database migration from 10.2.0.4 to 12c using the full database data pump method over db link. the DBA has advised that