tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Jenkins" <adamjenk...@hotmail.com>
Subject Re: Problem compiling servlets
Date Wed, 13 Sep 2000 22:57:45 GMT
could be a version clash...maybe check the version of servlet.jar that you 
compile on is the same as the one tomcat pulls from, don't know if that's 
the problem, just a suggestion (I haven't looked at 1.3 yet, but if you have 
servlet.jar in jre/lib/ext that is a later version than the one tomcat is 
using you could run into some problems, ie it will use the 
jre/lib/ext/servlet.jar to compile, but the jakarta-tomcat/lib/servlet.jar 
during runtime)...might be worth checking out.  Also, you should get into 
the habit of closing your streams. (ie out.close())


>From: "ann patil" <patilann@hotmail.com>
>Reply-To: tomcat-dev@jakarta.apache.org
>To: tomcat-dev@jakarta.apache.org
>Subject: Problem compiling servlets
>Date: Wed, 13 Sep 2000 16:13:33 IST
>MIME-Version: 1.0
>X-Originating-IP: [203.197.52.240]
>Received: from [63.211.145.10] by hotmail.com (3.2) with ESMTP id 
>MHotMailBB89111B0007D820F3A43FD3910A09670; Wed Sep 13 11:23:23 2000
>Received: (qmail 3204 invoked by uid 500); 13 Sep 2000 18:02:50 -0000
>Received: (qmail 3174 invoked from network); 13 Sep 2000 18:02:49 -0000
>From tomcat-dev-return-10846-adamjenkins Wed Sep 13 11:24:28 2000
>Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
>Precedence: bulk
>X-No-Archive: yes
>list-help: <mailto:tomcat-dev-help@jakarta.apache.org>
>list-unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
>list-post: <mailto:tomcat-dev@jakarta.apache.org>
>Delivered-To: mailing list tomcat-dev@jakarta.apache.org
>Message-ID: <F246AoirK6UtEnUyR530000aaaf@hotmail.com>
>X-OriginalArrivalTime: 13 Sep 2000 10:43:33.0265 (UTC) 
>FILETIME=[7679E810:01C01D6F]
>X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
>
>Hi! Can anybody please help me,
>
>       I am having problems compiling the servlets.
>
>
>Steps:
>1) In the server.xml I added the following code:
>  <Context path="/mytest" docBase="webapps/mytest"
>     defaultSessionTimeOut="30" isWARExpanded="true"
>               isWARValidated="false" isInvokerEnabled="true"
>               isWorkDirPersistent="false"/>
>
>2) In the web.xml I added the following code:
>  <servlet>
>       <servlet-name>
>           hello
>       </servlet-name>
>       <servlet-class>
>           hello
>       </servlet-class>
>   </servlet>
>
>3) Created a directory mytest under /webapps.
>
>4) Created a subdirectory web-inf/classes under /mytest.
>
>5) Created servlet : hello.java
>
>  import java.io.*;
>  import javax.servlet.*;
>  import javax.servlet.http.*;
>
>  public class hello extends HttpServlet
>  {
>         public void doGet(HttpServletRequest request,
>                   HttpServletResponse response)
>                   throws IOException, ServletException
>         {
>                response.setContentType("text/html");
>                PrintWriter out = response.getWriter();
>                out.println("<html><head>");
>                out.println("<title>Servlet Test</title>");
>                out.println("</head><body>");
>                out.println("Hello! Visit the ");
>out.println("<a href=\"http://internet.about.com\">");
>                out.println("About.com Internet Site</a>");
>                out.println("</body>");
>                out.println("</html>");
>         }
>   }
>
>6) Copied hello.java in \webapps\mytest\web-inf\classes directory.
>
>7) From 'Tomcat' home directory ie. c:\local\tomcat> issued command
>javac c:\local\tomcat\webapps\mytest\web-inf\classes\hello.java
>
>8) Result : 7 errors
>One of which is:
>
>symbol: Class HttpServlet
>location: class hello
>public class hello extends HttpServlet
>                          ^
>c:\local\tomcat\webapps\mytest\web-inf\classes\hello.java :7 cannot resolve
>symbol.
>
>Note:
>1) I have jdk1.3 on my system.
>2) Have no problem starting tomcat.
>3) My autoexec.bat looks this:
>
>File: Autoexec.bat
>
>set path=%path%;c:\jdk1.3\bin;c:\jdk1.3\lib;c:\jdk1.3\tools.jar
>set classpath=.;c:\jdk1.3\bin;c:\jdk1.3\lib;c:\jdk1.3\tools.jar%CLASSPATH%
>set path=%path%;.;c:\local\tomcat;c:\local\tomcat\lib;c:\local\tomcat\bin
>;c:\local\tomcat\src;c:\local\tomcat\conf;c:\local\tomcat\logs;c:\local\tomcat\work;c:\local\tomcat\docs;c:\local\tomcat\webapps;c:\local\tomcat\apachedll
>
>set classpath=.;c:\local\tomcat;c:\local\tomcat\lib;c:\local\tomcat\bin
>;c:\local\tomcat\src;c:\local\tomcat\conf;c:\local\tomcat\logs;c:\local\tomcat\work;c:\local\tomcat\docs;c:\local\tomcat\webapps;c:\local\tomcat\apachedll;c:\local\tomcat\lib\servlet.jar;c:\local\tomcat\webserver.jar;c:\local\tomcat\jasper.jar;c:\local\tomcat\xml.jar;c:\local\tomcat\ant.jar;c:\local\tomcat\classes%CLASSPATH%
>
>
>
>Do I need to make some additional enteries or can somebody help me to trace
>the problem.
>
>Thanks
>
>Ann.
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message