aspose file tools*
The moose likes Servlets and the fly likes compilation failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

compilation failed

Cathy Valdez
Greenhorn

Joined: Oct 22, 2003
Posts: 23
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\database\lib\conn_pool.jar;c:\Tomcat\common\lib\servlet.jar
set JAVA_HOME=c:\jdk1.3.1
I want to compile servlet files below so to make an example web application with database start and run in my PC.
InitializeConnectionPool.java
ScrambleGameServlet.java
servlet files above are located at the development directory path:
c:\ServletDevel\database\sl314\web\
Below is included in the source code for 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;

I compiled InitializeConnectionPool.java , by doing this:
c:\ServletDevel\database\sl314\web>javac InitializeConnectionPool.java
but compilation errors below occured:
InitializeConnectionPool.java:37: cannot resolve symbol
symbol: class NamingService
location: class sl314.web.InitializeConnectionPool
NamingService nameSvc = NamingService.getInstance();
^
InitializeConnectionPool.java:37: cannot resolve symbol
symbol: variable NamingService
location: class sl314.web.InitializeConnectionPool
NamingService nameSvc = NamingService.getInstance();
^
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();
^
Actually 5 errors.

Below is included in the source code for ScrambleGameServlet.java
package sl314.web;
// Domain import
import sl314.domain.ScrambleGameService;
import sl314.domain.WordCategoryService;
import sl314.domain.WordCategory;
import sl314.domain.Word;
// Servlet imports
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
// Support classes
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Iterator;

I compiled ScrambleGameServlet.java , by doing this:
c:\ServletDevel\database\sl314\web>javac ScrambleGameServlet.java
but compilation errors below occured:
ScrambleGameServlet.java:209: cannot resolve symbol
symbol: class WordCategory
location: class sl314.web. ScrambleGameServlet
WordCategory category = (WordCategory) cats.next();
^
ScrambleGameServlet.java:209: cannot resolve symbol
symbol: class WordCategory
location: class sl314.web. ScrambleGameServlet
WordCategory category = (WordCategory) cats.next();
^
ScrambleGameServlet.java:231: cannot resolve symbol
symbol: class ScrambleGameService
location: class sl314.web. ScrambleGameServlet
ScrambleGameService gameSvc
^
ScrambleGameServlet.java:232: cannot resolve symbol
symbol: class ScrambleGameService
location: class sl314.web. ScrambleGameServlet
(ScrambleGameService) session.getAttribute(�gameSvc�)
^
Actually 22 errors.

ScrambleGameService.java
WordCategory.java
WordCategoryDAO.java
WordCategoryService.java
WordDAO.java
Word.java
servlet files above are located at the development directory path:
c:\ServletDevel\database\sl314\domain\

Below is included in the source code for WordCategory.java
package sl314.domain;

I compiled WordCategory.java, by doing this:
c:\ServletDevel\database\sl314\domain>javac WordCategory.java
compilation for WordCategory.java is successful.

Below is included in the source code for ScrambleGameService.java
package sl314.domain;
import java.util.Random;

I compiled ScrambleGameService.java , by doing this:
c:\ServletDevel\database\sl314\domain>javac ScrambleGameService.java
but compilation errors below occured:
ScrambleGameService.java:7: cannot resolve symbol
symbol: class Word
location: class sl314.domain.ScrambleGameService
private Word theWord;
^
ScrambleGameService.java:12:cannot resolve symbol
symbol: class Word
location: class sl314.domain.ScrambleGameService
public ScrambleGameService (Word theWord){
^
ScrambleGameService.java:12:cannot resolve symbol
symbol: class Word
location: class sl314.domain. ScrambleGameService
public Word getWord(){
^
3 errors

Below is included in the source code for Word.java
package sl314.domain;
// no imports

I compiled Word.java , by doing this:
c:\ServletDevel\database\sl314\domain>javac Word.java
but compilation errors below occured:
Word.java:5:cannot resolve symbol
symbol: class WordCategory
location: class sl314.domain.Word
public WordCategory category;
^
Word.java:10:cannot resolve symbol
symbol: class WordCategory
location: class sl314.domain.Word
Word (WordCategory category, String word,
^
Word.java:22:cannot resolve symbol
symbol: class WordCategory
location: class sl314.domain.Word
public WordCategory getCategory(){
^
3 errors

Below is included in the source code for WordCategoryDAO.java
package sl314.domain;
import sl314.util.NamingService;
import sl314.util.sql.ConnectionPool;
import sl314.util.sql.ObjectNotFoundException;
import sl314.util.sql.ConnNotAvailException;
import sl314.util.sql.ShuttingDownException;
import sl314.util.sql.WrongPoolException;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.LinkedList;
import java.util.ArrayList;

I compiled WordCategoryDAO.java , by doing this:
c:\ServletDevel\database\sl314\domain>javac WordCategoryDAO.java
but compilation errors below occured:
WordCategoryDAO.java:32:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryDAO
WordDAO wordDataAccess = new WordDAO();
^
WordCategoryDAO.java:32:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryDAO
WordDAO wordDataAccess = new WordDAO();
^
WordCategoryDAO.java:55:cannot resolve symbol
symbol: class WordCategory
location: class sl314.domain.WordCategoryDAO
WordCategory categoryObject
^
WordCategoryDAO.java:56:cannot resolve symbol
symbol: class WordCategory
location: class sl314.domain.WordCategoryDAO
= new WordCategory (category, description, numberOfWords);
^
Actually 7 errors

Below is included in the source code for WordCategoryService.java
package sl314.domain;
import java.util.List;

I compiled WordCategoryService.java , by doing this:
c:\ServletDevel\database\sl314\domain>javac WordCategoryService.java
but compilation errors below occured:
WordCategoryService.java:20:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryService
WordDAO wordDataAccess = new WordDAO();
^
WordCategoryService.java:20:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryService
WordDAO wordDataAccess = new WordDAO();
^
WordCategoryService.java:26:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryService
WordDAO wordDataAccess = new WordDAO();
^
WordCategoryService.java:26:cannot resolve symbol
symbol: class WordDAO
location: class sl314.domain.WordCategoryService
WordDAO wordDataAccess = new WordDAO();
^
Actually 9 errors

Below is included in the source code for WordDAO.java
package sl314.domain;
import sl314.util.NamingService;
import sl314.util.sql.ConnectionPool;
import sl314.util.sql.ObjectNotFoundException;
import sl314.util.sql.ConnNotAvailException;
import sl314.util.sql.ShuttingDownException;
import sl314.util.sql.WrongPoolException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

I compiled WordDAO.java , by doing this:
c:\ServletDevel\database\sl314\domain>javac WordDAO.java
but compilation errors below occured:
WordDAO.java:150: cannot resolve symbol
symbol: class NamingService
location: class sl314.web.WordDAO
NamingService nameSvc = NamingService.getInstance();
^
WordDAO.java:150: cannot resolve symbol
symbol: class NamingService
location: class sl314.web.WordDAO
NamingService nameSvc = NamingService.getInstance();
^
WordDAO.java:212: cannot resolve symbol
symbol: class NamingService
location: class sl314.web.WordDAO
NamingService nameSvc = NamingService.getInstance();
^
WordDAO.java:212: cannot resolve symbol
symbol: class NamingService
location: class sl314.web.WordDAO
NamingService nameSvc = NamingService.getInstance();
^
Actually 14 errors

NamingService.java
servlet file above is located at the development directory path:
c:\ServletDevel\database\sl314\util\
Below is included in the source code for NamingService.java
package sl314.util;
import java.util.Map;
import java.util.HashMap;

I compiled NamingService.java, by doing this:
c:\ServletDevel\database\sl314\util>javac NamingService.java
compilation for NamingService.java is successful.

What should I do to correct these errors? Can anybody there help?
Any suggestions would be appreciated.
Thanks in advance.
Regards,
Cathy
 
 
subject: compilation failed