"cannot resolve symbol" error
843810Oct 28 2004 — edited Jan 20 2005I am getting the following message when trying to compile. I can't seem to find my way around it. GeocodeServer.class exists in the C:\Tomcat4129\webapps\servlet\WEB-INF\classes directory. Does it need to be somewhere else? I have a copy also in C:\Tomcat4129\webapps\servlet\WEB-INF\classes\com\esri\custom.
C:\Tomcat4129\webapps\servlet\WEB-INF\classes>javac -classpath C:\Tomcat4129\com
mon\lib\servlet.jar GeoServlet.java
GeoServlet.java:32: cannot resolve symbol
symbol : class GeocodeServer
location: class com.esri.custom.GeoServlet
GeocodeServer gs = new GeocodeServer();
^
GeoServlet.java:32: cannot resolve symbol
symbol : class GeocodeServer
location: class com.esri.custom.GeoServlet
GeocodeServer gs = new GeocodeServer();
^
2 errors
******************************************************************************************
package com.esri.custom;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class GeoServlet extends HttpServlet
{
public void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
//Input values retrieved from an incoming request
String service = request.getParameter("service");
String street = request.getParameter("street");
String zone = request.getParameter("zone");
// Retrieve properties set in the "sdegeo_prop" file
InputStream in = this.getClass().getResourceAsStream("sdegeo_prop");
java.util.Properties p = new java.util.Properties();
p.load(in);
in.close();
String server = p.getProperty("server");
int port = Integer.parseInt(p.getProperty("port"));
String database = p.getProperty("database");
String user = p.getProperty("user");
String password = p.getProperty("password");
// Create a new GeocodeServer instance
GeocodeServer gs = new GeocodeServer();
// Initialize the connection to the ArcSDE database on which the geocoding
service was created
gs.init(server, port, database, user, password);
// Pass the service name, and address input values, in this case street and
zone
gs.geocode(service, street, zone);
// Retrieve the x and y coordinates, match score and standardized address
Double x = gs.getX();
Double y = gs.getY();
Short score = gs.getScore();
String address = gs.getAddress();
// Create the HTML page which contains the geocoding results
String htmlResp = "";
if (x != null){
htmlResp = "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;
charset=\"ISO-8859-1\">";
htmlResp = htmlResp + "<HTML><HEAD>";
htmlResp = htmlResp + "<SCRIPT TYPE=\"text/javascript\"
LANGUAGE=\"JavaScript\">function passXML() {";
htmlResp = htmlResp + "var X=" + x +";";
htmlResp = htmlResp + "var Y=" + y +";";
htmlResp = htmlResp + "parent.MapFrame.SDEGeoSend(X, Y); }";
htmlResp = htmlResp + "</SCRIPT></HEAD><BODY BGCOLOR=\"Silver\"
onload=\"passXML()\">";
htmlResp = htmlResp + "<FONT FACE=\"Arial\" SIZE=\"-1\"><b>Locate
Result</b>";
htmlResp = htmlResp + "<TABLE border=\"1\" cellspacing=\"0\"
cellpadding=\"2\" nowrap bgcolor=\"White\">";
htmlResp = htmlResp + "<TR>";
htmlResp = htmlResp + "<TH>";
htmlResp = htmlResp + "Address";
htmlResp = htmlResp + "</TH>";
htmlResp = htmlResp + "<TH>";
htmlResp = htmlResp + "Score";
htmlResp = htmlResp + "</TH>";
htmlResp = htmlResp + "</TR>";
htmlResp = htmlResp + "<TR>";
htmlResp = htmlResp + "<TD>";
htmlResp = htmlResp + address;
htmlResp = htmlResp + "</TD>";
htmlResp = htmlResp + "<TD>";
htmlResp = htmlResp + score;
htmlResp = htmlResp + "</TD>";
htmlResp = htmlResp + "</TR>";
htmlResp = htmlResp + "</TABLE></FONT>";
htmlResp = htmlResp + "</BODY></HTML>";
} else {
htmlResp = htmlResp + "<HTML><BODY>";
htmlResp = htmlResp + "Address not found.";
htmlResp = htmlResp + "</BODY></HTML>";
}
PrintWriter out;
// Set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
out = response.getWriter();
out.println(htmlResp);
out.close();
}
public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
doGet(request, response);
}
}