Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2007, 01:34 AM
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tomcat and Servlet Beginner

hi every body,
i am new to servlets and tomcat.
i did exactly the following steps.
- i downloaded j2sdk1.4.2
- i set the java home to c:\j2sdk1.4.2
- i downloaded tomcat 3.3
- i set the tomcat home to c:\program files\jakarta-tomcat-3.3.2
- I set the classpath to "C:\Program Files\jakarta-tomcat-3.3.2\lib\common\servlet.jar;
C:\Program Files\j2sdk1.4.2-14\bin"

i wrote that small code just to test and i am going to complete it later


package MyFirstUIMIDPPackage;
import java.*;
import javax.*;

public class MyDataBaseServlet
{

    private String jdbcDriver=null;
    private String jdbcUrl=null;
    private String jdbcUsername=null;
    private String jdbcPassword=null;
    private String errorMessage=null;


    public void init()
    {
        jdbcDriver=getInitParameter("jdbc.driver");
    }

}


i placed MyDataBaseServlet.java in c:\j2sk1.4.2-14\bin


and iam trying to compile it

C:\j2sdk1.4.2_14\bin>javac MyDataBaseServlet.java MyDataBaseServlet.java:3: package javax does not exist import javax.*; ^ MyDataBaseServlet.java:17: cannot resolve symbol symbol : method getInitParameter (java.lang.String) location: class MyFirstUIMIDPPackage.MyDataBaseServlet jdbcDriver=getInitParameter("jdbc.driver"); ^ 2 errors


and i got that error

i dont know how to fix it and i dont know if i am doing any thing wrong

plz any body that could help me as soon as possible plz do
i am lost
thanks

raghda
 
Old May 14th, 2007, 10:14 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,
This error comes when you dont have servlet/jsp api jar files in class path. Add servlet-api.jar and jsp-api.jar files which are in TOMCAT_HOME/common/lib directory to your class path and then try to compile your code.

Regards,
Rakesh
 
Old May 17th, 2007, 06:32 AM
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
i tried that and it works thank u

Raghda

raghda





Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle Servlet Engine Using with Tomcat goback Apache Tomcat 7 July 13th, 2007 03:16 PM
About Tomcat: How to use servlet-api.jar smshinde Apache Tomcat 3 July 12th, 2006 02:05 PM
Servlet is running after tomcat is stopped. pandian Apache Tomcat 3 January 2nd, 2006 07:56 AM
Problem with Servlet from Tomcat to Apache holdmykidney Servlets 0 April 28th, 2005 07:38 AM
servlet with tomcat problem... thiNkspAce Apache Tomcat 2 October 23rd, 2004 05:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.