Package javax.servlet not found error

package javax.servlet not found error. how it can be solved.
plz help this is my first servlet program.
vipin

You need a jar file that has in it the javax.servlet.* classes
It should be distributed with your servlet/jsp server.
It can normally be found in a /lib directory under the installation.
Some examples:
Tomcat4: install_dir\common\lib\servlet.jar
Tomcat5: install_dir\common\lib\servlet-api.jar; install_dir\common\lib\jsp-api.jar
J2sdkee: install_dir/lib/j2ee.jar
You need to include this jar file in your classpath when you compile any servlet.

Similar Messages

  • Package javax.ejb not found error

    Hi there,
    I've downloaded j2se 1.4 and j2ee 1.3.1 and installed it on Windows XP. I set the environment variables as described. When I compile a .java file that imports the javax.ejb.* package, then I get an error "package javax.ejb not found". I feel like an idiot and I know it's something to do with the environment variables. (or just XP, most likely)
    Thanks in advance
    Hoenner

    How are you compiling your source? If you're using an IDE then you should edit your project classpath to include the j2ee.jar file (it'll probably be in the lib directory of your J2EE installation).
    If you're doing it from the command line then type in SET CLASSPATH, look at the classpath it returns and check that it includes the j2ee.jar file.
    Hope this helps.

  • Package javax.servlet not found in sdk 1.4.0_01

    Hi,
    Please correct me if i'm wrong. I was using j2sdk 1.3.1 (standard edition) and have recently upgraded to j2sdk1.4.0_01. I can't find the javax.servlet package in the API. I referred to the j2ee sdk and found the package there. Does it mean that I need to have both the j2sdk1.4.0_01 and the j2sdkee1.3.1 (j2ee) in order to be able to compile and run my codes?
    Thanks.
    Karen

    The servlet packages don't come with the standard SDK.
    You can get them from javasoft.com or if you use the
    Tomcat server they come packaged in a jar file called
    servlet.jar

  • Compiling servlets - package javax.servlet not found

    I can't seem to get the previous questions on this topic - get a page error. I've recently installed j2ee1.4 and j2sdk1.4.1_01 on Win98. I think I've set the CLASSPATH and PATH correctly (and JAVA_HOME). What have I missed?

    servlet.jar in your classpath...

  • Package javax.swing not found in import!

    I recently installed JDK 1.3.1_02 on WinNT4.0 and I cannot compile javax
    packages without getting the following error:
    Package javax.swing not found in import
    I've tried every combination of modifying the CLASSPATH system variable
    I can think of. I have no problem compiling java packages but not
    javax packages. I followed the installation instructions to the letter.
    What am I missing? Surely someone is running the same version of
    the JDK I am on WinNT 4.0.

    Thanks again!!! I had an older version of javac running on my system any time I ran
    outside of the bin where the latest javac was installed. I removed the older version
    of the jdk and now I can compile from any directory. I really appreciate the help,
    I was wracking my brain.
    By the way, -version is not a valid flag for javac.exe, although it is for java.exe.
    signed,
    grateful in cyberspace

  • Package javax.mail not found in import.

    hi,
    i am trying to develop a mail application using jsp, i have jaf1.0.1 and javamail API and the application was working fine on weblogic but when i tried to do the same thing on Apache server the Package javax.mail not found in import. is occuring,
    What could be the problem can any one explain...
    Thanks

    I think you have not placed mail.jar and activation.jar files in the /jre/lib/ext directory. Just place the mail.jar and activation.jar files in the jdk's /jre/lib/ext directory and check out. This will work for you.
    Rkanthj

  • Package corejava.Math not found error !??

    hi, I tried to compile this code but got the
    following error message ----
    what does it mean ????
    ==================================================
    TextSummary.java:17: Package corejava.Math not found in import.
    import corejava.Math.*;
    ^
    TextSummary.java:18: Package corejava not found in import.
    import corejava.*;
    ^
    2 errors
    ==================================================
    /** * @(#)TextSummary.java * * Copyright (c) 2000 by Sundar Dorai-Raj
    * * @author Sundar Dorai-Raj
    * * Email: [email protected]
    * * This program is free software; you can redistribute it and/or
    * * modify it under the terms of the GNU General Public License
    * * as published by the Free Software Foundation; either version 2
    * * of the License, or (at your option) any later version,
    * * provided that any use properly credits the author.
    * * This program is distributed in the hope that it will be useful,
    * * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * * GNU General Public License for more details at http://www.gnu.org * * */
    package corejava.Graphics;
    import java.awt.*;
    import corejava.Math.*;
    import corejava.*;
    public class TextSummary extends Canvas {
    private Univariate x=null;
    private int width,height;
    private Dimension size;
    private Font font;
    private boolean box;
    private int[] margins;
    private Color textColor;
    private Image offScrImage;
    private Graphics offScrGraphics;
    /* define constants */
    public final static Font DEFAULT_FONT=new Font("Courier",Font.PLAIN,10);
    public final static Color DEFAULT_COLOR=Color.black;
    public final static Format f=new Format("%1.4f");
    public TextSummary() { super(); }
    public void addNotify() {
    super.addNotify();
    offScrImage=createImage(width,height);
    offScrGraphics=offScrImage.getGraphics();
    public void update(Graphics g) {
    paint(offScrGraphics);
    g.drawImage(offScrImage,0,0,this);
    public TextSummary(int width,int height) {
    this.width=width;
    this.height=height;
    size=new Dimension(width,height);
    margins=new int[4];
    margins[0]=10;
    margins[1]=10;
    margins[2]=10;
    margins[3]=10;
    super.setBackground(Color.white);
    box=false;
    font=DEFAULT_FONT;
    textColor=DEFAULT_COLOR;
    public TextSummary(int width,int height,Font font,Color textColor) {
    this.width=width;
    this.height=height;
    size=new Dimension(width,height);
    margins=new int[4];
    margins[0]=10;
    margins[1]=10;
    margins[2]=10;
    margins[3]=10;
    super.setBackground(Color.white);
    box=false;
    this.font=font;
    this.textColor=textColor;
    public TextSummary(int width,int height,boolean box) {
    this.width=width;
    this.height=height;
    size=new Dimension(width,height);
    this.box=box;
    margins=new int[4];
    margins[0]=10;
    margins[1]=10;
    margins[2]=10;
    margins[3]=10;
    super.setBackground(Color.white);
    font=DEFAULT_FONT;
    textColor=DEFAULT_COLOR;
    public TextSummary(int width,int height,Font font,Color textColor,boolean box) {
    this.width=width;
    this.height=height;
    size=new Dimension(width,height);
    this.box=box;
    margins=new int[4];
    margins[0]=10;
    margins[1]=10;
    margins[2]=10;
    margins[3]=10;
    super.setBackground(Color.white);
    this.font=font;
    this.textColor=textColor;
    public void newData(double[] data,boolean plot) {
    x=new Univariate(data);
    if(plot) repaint();
    public void newData(Univariate data,boolean plot) {
    x=data;
    if(plot) repaint();
    public void setMargins(int[] margins) {
    this.margins=(int[])margins.clone();
    public void setGraphicsParams(Font font,Color textColor,boolean box) {
    this.font=font;
    this.textColor=textColor;
    this.box=box;
    public void paint(Graphics g) {
    if(x==null) return;
    g.setColor(Color.white);
    g.fillRect(0,0,width-1,height-1);
    g.setFont(font);
    g.setColor(textColor);
    FontMetrics fm=getFontMetrics(font);
    int yOrigin=height,
    xOrigin=0,
    bottom=-margins[0],
    left=margins[1],
    top=margins[2],
    right=margins[3],
    center=(int)((width-left-right)*.5),
    quarter=(int)((width-left-right)*0.25),
    textWidth,
    textHeight=fm.getHeight();
    textWidth=fm.stringWidth("Summary");
    g.drawString("Summary",left+center-(int)(textWidth*.5),top+textHeight);
    g.drawLine(left,top+textHeight+2,width-right,top+textHeight+2);
    g.drawLine(left,top+textHeight+3,width-right,top+textHeight+3);
    textWidth=fm.stringWidth("N");
    g.drawString("N",quarter-textWidth,top+2*textHeight);
    textWidth=fm.stringWidth(""+x.size());
    g.drawString(""+x.size(),center-textWidth,top+2*textHeight);
    textWidth=fm.stringWidth("Mean");
    g.drawString("Mean",quarter-textWidth,top+3*textHeight);
    textWidth=fm.stringWidth(f.form(x.mean()));
    g.drawString(f.form(x.mean()),center-textWidth,top+3*textHeight);
    textWidth=fm.stringWidth("Var");
    g.drawString("Var",quarter-textWidth,top+4*textHeight);
    textWidth=fm.stringWidth(f.form(x.variance()));
    g.drawString(f.form(x.variance()),center-textWidth,top+4*textHeight);
    textWidth=fm.stringWidth("Stdev");
    g.drawString("Stdev",quarter-textWidth,top+5*textHeight);
    textWidth=fm.stringWidth(f.form(x.stdev()));
    g.drawString(f.form(x.stdev()),center-textWidth,top+5*textHeight);
    textWidth=fm.stringWidth("SE");
    g.drawString("SE",quarter-textWidth,top+6*textHeight);
    textWidth=fm.stringWidth(f.form(x.SE()));
    g.drawString(f.form(x.SE()),center-textWidth,top+6*textHeight);
    textWidth=fm.stringWidth("Min");
    g.drawString("Min",3*quarter-textWidth,top+2*textHeight);
    textWidth=fm.stringWidth(f.form(x.min()));
    g.drawString(f.form(x.min()),width-right-textWidth,top+2*textHeight);
    textWidth=fm.stringWidth("Q1");
    g.drawString("Q1",3*quarter-textWidth,top+3*textHeight);
    textWidth=fm.stringWidth(f.form(x.quant(0.25)));
    g.drawString(f.form(x.quant(0.25)),width-right-textWidth,top+3*textHeight);
    textWidth=fm.stringWidth("Median");
    g.drawString("Median",3*quarter-textWidth,top+4*textHeight);
    textWidth=fm.stringWidth(f.form(x.median()));
    g.drawString(f.form(x.median()),width-right-textWidth,top+4*textHeight);
    textWidth=fm.stringWidth("Q3");
    g.drawString("Q3",3*quarter-textWidth,top+5*textHeight);
    textWidth=fm.stringWidth(f.form(x.quant(0.75)));
    g.drawString(f.form(x.quant(0.75)),width-right-textWidth,top+5*textHeight);
    textWidth=fm.stringWidth("Max");
    g.drawString("Max",3*quarter-textWidth,top+6*textHeight);
    textWidth=fm.stringWidth(f.form(x.max()));
    g.drawString(f.form(x.max()),width-right-textWidth,top+6*textHeight);
    g.drawLine(left,top+6*textHeight+2,width-right,top+6*textHeight+2);
    g.drawLine(left,top+6*textHeight+3,width-right,top+6*textHeight+3);
    /* Canvas Functions */
    public Dimension getPreferredSize() {
    return(size);
    public Dimension getMinimumSize() {
    return(size);

    I'd guess there's a package corejava.Math, which is needed for this code to compile, but you don't have it...

  • Servlet not found error

    Hi everyone,
    i am trying to write a chat application using applet,servlet and RMI.
    so i have my servlet and aaplets accordingly...
    but when i put my servlet and applets in their respective folder of tomcat,i am getting and error..which is as follows....
    Resource not found: http://10.0.2.65:8080/servlet/ChatServlet
    The configuration that i am using is:
    1)win XP
    2)Tomcat5.1
    3)JDK 1.5
    my servlet file is 'ChatServlet.class',which is placed in a package(or folder) called 'servlet'...
    so i have place the whole package(servlet) in WEB-INF...
    and the mapping that i have given in web.xml is as follows:
    <servlet>
    <servlet-name>ChatServlet</servlet-name>
    <servlet-class>ChatServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ChatServlet</servlet-name>
    <url-pattern>/ChatServlet</url-pattern>
    </servlet-mapping>
    NOW is that mapping correct??
    Do you find anything wrong in the way i have put my files in Tomcat??
    and also if possible please tell me for what is these mapping in web.xml used??
    thanx in advance

    thanx a lot for the reply...
    i did put the full class name of the servlet....but had no success....
    now my maaping is as follows:
    <servlet>
    <servlet-name>ChatServlet</servlet-name>
    <servlet-class>servlet/ChatServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ChatServlet</servlet-name>
    <url-pattern>/ChatServlet</url-pattern>
    </servlet-mapping>

  • Javax.servlets not found

    when i try to import the javax.servlet's, it is not found... any idea where i can go toget that? i downloaded the seperate elipse for J2EE and tried it on there, and i also tried it on the eclipse for regular java developers.
    thanks
    update: it turns out that eclipse has a # of requirements that it needs to get the WTP, i'll appreciate any assistance in directing me toward the files.
    Edited by: ixxalnxxi on Jun 17, 2008 3:30 AM

    No, you need to specify the application server in the eclipse project. Then it will take its libraries in the build path.
    You may find this tutorial useful, you can just skip the JSF part if you aren't planning to use it: [http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html].

  • Package javax.faces not found

    Hi,
    I tried to import the package javax.faces.* but it can not be resolved. Do I have to download this package myself? I'm using jre1.5.
    Thanks!

    JSF isn't part of core Java. You need to download it separately, in a number of ways, and then include it in your compile-time classpath, and put it somewhere your container can get hold of it, too

  • IsItWorking Servlet not Found Error

    Hi All
    After i installed the Oracle 9i App Server on win2k Server , when i tried to access the IsItWorking Servlet through the jserv engine using the following URL
    http://localhost:7778/servlet/IsItWorking , I get the following error in the error log of the Apache WebServer.
    File does not exist: /servlet/IsItWorking
    What could be the problem? The configuration files ,jserv.conf,jserv.properties and zone.properties havent changed.
    can someone pls help.
    Thanx in advance.

    Thanx Andrew for the reply.
    I tried to search for the entry orcladmin and the search fails with an Error code 106(Search criteria doesnt match any entries.This bamboozled me completely as iam logged into the OID thru ODM but cant find the orcladmin entry...something bad....
    Then I relaised that my SSO COnfiuration Assistant/Internet Directory Configuration Assistant must have failed.
    This is what is happening.
    My Oracle Internet Directory Server(OID) is running on port 389(non-ssl default) and the configuration assistants are trying to connect to port 4032.
    I Tried 2 WorkArounds which failed
    WorkAround 1: Tried Runnning the OID on port 4032
    I tried to run the OID on port 4032 using
    (oidctl connect=iasdb server=oidldapd instance=1 flags='-p 4032' start)
    but it fails.I could see it from the LDAP LOGS ($ORACLE_HOME\ldap\logs\oidmon.log)..The OID Monitor just adds that instance and deletes it from the registry as it is unable to start the OID Server..
    But other instances could be started on port 389 though...
    WorkAround 2:
    I tried to run the SSOConfigAssistant from the command line as :
    java -jar D:\oracleinfra\sso\lib\ossoca.jar D:\oracleinfra orasso orasso
    hydtrn01.mydomain.com 389 "orcladmin" welcome hydtrn01.mydomain.com 1521
    iasdb AMERICAN_AMERICA.WE8MSWIN1252
    But this throws me off giving an error.
    Failed to obtain OiD password. Exception is :java.lang.Exception: Version mismat
    ch!.
    Iam not sure wherez the SSoConfigAssistant getting the OID Passwd from...
    Iam not sure as to how to proceed frm here other than Reinstalling...Also the Unistallation isnt clean as it leaves a lot of entries in the registry on win2k..
    Any help would be mightly appreciated
    Thanx in Advance.

  • Import javax.crypto not found error

    Hi,
    I have just installed the JDK1.7 on a windows machine.
    Whenever I try to compile my module, I get an error on the import javax.crypto line. It tells me that it can't the javax\Crypto\Cipher.class.
    I have the jdk installed on d:\glassfish3 and am pointing the classpath to d:\glassfish3\jdk7 (also tried d:\glassfish3\jdk7\jre as well) with no luck.
    Any help would be greatly appreciated.
    Thanks,
    Drew Nathanson
    Technical Synergy, Inc.

    Thanks. Maybe I should explain a little better.
    I am using JBuilder 2006 to my IDE. This environment requires that you put in the path to the JRE/JDK.
    I have uninstalled and downloaded the jdk again and this time i'm getting a strange error:
    "test.java": cannot access javax.crypto.Cipher; bad class file: D:\Program Files\Java\jre7\lib\jce.jar\javax\crypto\Cipher.class, class file has wrong version 51.0, should be 49.0, Please remove or make sure it appears in the correct subdirectory of the classpath. at line 19, column 21
    Now this is strange because i'm using the right library.
    Is there something that I'm missing here?
    Again, thanks for your help.
    Drew Nathanson

  • Javax class not found error.

    First and formost, apologies if this is in the wrong forum.
    I'm running NB 6.1 and trying to add the new kewl mysql features to my servlet. It automatically added all the code and inserted imports for javax.
    For some reason it says that it can't find the following classes:
    import javax.persistence.CascadeType;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.OneToMany;
    import javax.persistence.Table;However it does recognise that javax.persistence exists.
    I've tried running it with both jdk 5 & 6 with no luck.
    I'm sure Javax is inbuilt, Is there something I'm missing?

    Ok, the classes are included if the glassfish server is running, since I'm running Tomcat I created a library with all the classes in it and added it to my project.
    I was then able to use the entity classes I created with no bother.
    Then I proceeded to install RESTful webservices. and add the restfull webservices to the project.
    Now if I run/debug the main project, it doesn't run my main servlet!!!
    When running test Restful webservices I receives: Cannot acces WADL: Please restart your RESTfull webservices and reload this page.
    How do I get the project to run the orginal servlet now and bypass the restfull web service?
    How do I fix the Restfull problem

  • Import javax.mail not found

    Hello,
    I am new to Java Mail. I wanted to test my first programme. When I compile, I get this errors.
    package javax.mail not found in import and so on. I have set my classpath to so
    set classpath = %classpath%;C:\j2sdk1.4.0\lib\mail.jar;C:\j2sdk1.4.0\lib\activation.jar
    I included the mail.jar,smtp.jar and activation.jar in the lib directory of my jdk e.g c:\j2sdk1.4.0\lib\ "the jar file".
    Can any one tell me what I am missing here?
    Thanks
    James

    the easiest way to do this is to put
    activation.jar
    mail.jar          
    mailapi.jar     
    imap.jar     
    smtp.jar          
    pop3.jar
    into the virtual machine directory C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext
    or the lib\ext directory of whatever virtual machine you are using
    and put coppies of them in JDK
    C:\j2sdk1.4.0-beta3\jre\lib\ext
    or jre\lib\ext
    of whatever JDK you are using
    this way they are found automaticaly
    no need for classpath

  • Error:    package javax.servlet.http does not exist

    Hi all,
    How do I import javax.servlet?
    package com.example.web;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class BeerSelect extends HttpServlet {
      public void doPost(HttpServletRequest request,
                         HttpServletResponse response)
                         throws IOException, ServletException {
        response.setContentType("text/html");
        PrintWriter out = response.getWrite();
        out.println ("Beer Selection Advide<br>");
        String c = request.getParameter("color");
        out.println ("<br>Got beer color " + c);
    }What does this error mean? The error message:
    Compiling 1 source file to C:\Program Files\Apache Software Foundation\MyProjects\J2EE\build\classes
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:3:
    package javax.servlet does not exist
    import javax.servlet.*;
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:4:
    package javax.servlet.http does not exist
    import javax.servlet.http.*;
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:7:
    cannot find symbol
    symbol: class HttpServlet
    public class BeerSelect extends HttpServlet {
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:8:
    cannot find symbol
    symbol  : class HttpServletRequest
    location: class com.example.web.BeerSelect
      public void doPost(HttpServletRequest request,
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:9:
    cannot find symbol
    symbol  : class HttpServletResponse
    location: class com.example.web.BeerSelect
                         HttpServletResponse response)
    C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:10:
    cannot find symbol
    symbol  : class ServletException
    location: class com.example.web.BeerSelect
                         throws IOException, ServletException {
    6 errors
    BUILD FAILED (total time: 0 seconds)Thank you.

    Hi,
    The file servlet-api.jar / servlet.jar is not available in your classpath.
    To compile an Servlet you need the jar file to be in classpath.
    The jar file can be found in your webserver / application server lib folder.
    Regards,
    Zack

Maybe you are looking for

  • [SOLVED] Can somebody explain how to connect with BitlBee to Jabber?

    I've read archwiki about bitlbee ssh and irssi setup, but still can't connect. So what I do, as soon as I start "irssi" I enter "/connect im.bitlbee.org", then "/join #bitlbee", then I get into a chatscreen, where I should enter "help commands" or "h

  • Load balancing using GLBP

    Dear All, I need to built a scenario where i am using two ISP's for redundancy for my internal network and at the same time wants to load balance in such a way that my first packet going outside the network (using NAT) goes from first ISP's public ip

  • Logs for copied files

    Hello, Is there somewhere a log file that shows wich files are copied (from HD to HD, to a burning Program, or copied over the network). Thanks

  • Problem with duplaicate records

    Hi all i have dat block base on tables areas. DESC AREAS AREA_ID P.K AREA_CODE NUMBER, AREA_UNIT NUMBER; select * from areas ; AREA_ID  |AREA_CODE |AREA_UNIT 1             |   10           |     'A' 2             |   10           |     'B' 3         

  • Exchanging files between eMac and iMac Intel ( GUID Scheme hard drive bug )

    Hi, I have to exchange big file and folder regularly between 2 Mac ( Home and work ), before it was easy because both computer are eMac ( 700 mhz combo drive OS X 10.3.9 ) I used my firewire backup drive to transferred files. Now I change my home com