Javax.servlet  ERROR

Hello I new in jsp!!!
I'm compiling a basic jsp project for run on tomcat. The compiler send me and error message javax.servlet does not exist and it's because I only jave instaled the j2sdk. (I think)
What the library that a must download from java to succelfully compil it.
Thanks a lot and sorry for my english.
Diego

If you have Tomcat, then you have the javax.servlet library, and you just need to include it in your classpath at compile time.
It will be in the [tomcat]/common/lib/ directory
Basically if you have -
Tomcat4, the jar you need servlet.jar
Tomcat 5: you need servlet-api.jar and jsp-api.jar
Check out this useful page on setting up Tomcat: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ - specifically the bit on setting your classpath.
Note this only applies to compiling your own servlets. JSPs are automatically compiled by Tomcat.
Cheers,
evnafets

Similar Messages

  • Dont have "javax.servlet.jsp.JspException errors" in my logs (WebLogic 9.2)

    Hi,
              I have 2 servers.
              One with WebLogic6.1 & one with WebLogic9.2
              With WL6.1, i have errors like :
              <i>
              <2 août 2006 13:00:20 IRST> <Error> <HTTP> <[WebAppServletContext(10414345,imargo,/imargo)] Root cause of ServletException
              javax.servlet.jsp.JspException: Missing message for key MG01.loc.index
              at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297)
              at jsp_servlet._jsp.__im_in_tec_MGN01_MGN001._jspService(__im_in_tec_MGN01_MGN001.java:1711)
              </i>
              With WL9.2, i don't have those errors in my logs...
              I have no errors o_o
              Help me plz
              Many thanks

    I never used DynaActionForm, what I have noticed here is, don't you need to declare the form bean? I may be wrong.
    <form-beans>
    <form-bean name="newProdForm" type="com.package.form.NewProdForm"></form-bean>
    </form-beans>

  • Getting  javax.servlet.ServletException: General error

    Someone pls help me....
    I am getting General Error while inserting a row in database.I am not able to solve this error...I would really appreciate your help...Thanks in advance...
    Following is my Code ::
    <%! int countBts,countBts1,mmm; %>
    <%! String msg; %>
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String dataSourceName = "ProjData";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection conn = DriverManager.getConnection(dbURL, "","");
    int dataMgx= Integer.parseInt(request.getParameter("allocMgxId"));
    int dataFrsm=Integer.parseInt(request.getParameter("allocFrsmSlotNo"));
    int dataPort=Integer.parseInt(request.getParameter("allocPortNo"));
    int dataBts=Integer.parseInt(request.getParameter("bts1"));
    int dataRpm=Integer.parseInt(request.getParameter("allocRpmNo"));
    int dataMultiLink=Integer.parseInt(request.getParameter("allocMultiLinkNo"));
    String dataPortStatus= "vacant";
    Statement myStat1 = conn.createStatement();
    myStat1.execute("select count(BTS_ID) from MGX where BTS_ID=" + dataBts);
    ResultSet result1 = myStat1.getResultSet();
    if(result1.next())
         countBts=Integer.parseInt(result1.getString(1));
    countBts1=countBts+1;
    if(countBts > 6)
         msg="Configuration of more than 6 spans not allowed";
    %>
    <h3><%=msg %></h3>
    <%}
    else
    PreparedStatement stmt1 =
    conn.prepareStatement(("Insert into MGX (BTS_ID,Port_Status,MGX_Num,Port_No,FRSM_No,RPM_Card,Multi_Link) values ("+dataBts+",'"+dataPortStatus+"',"+dataMgx+","+dataPort+","+dataFrsm+","+dataRpm+","+dataMultiLink+")"));
    mmm =     stmt1.executeUpdate();
    stmt1.close();
    if(mmm == 1)
    msg="One SpanRecord successfully added in the Database ";
    else
    msg="Failure in Update Operation";     
         result1.close();
         myStat1.close();
         conn.close();           
    %>
    The error I am getting is as follows::
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: General error
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
         org.apache.jsp._5_jsp._jspService(_5_jsp.java:179)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.sql.SQLException: General error
         sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6987)
         sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3150)
         sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
         sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:136)
         org.apache.jsp._5_jsp._jspService(_5_jsp.java:121)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    Pls Help me

    Thanks for the reply buddy...
    As per your reply....I have tried modifying my Preparedstatement properly with ? and then binding values...
    But even after doing this i am still getting the same error....
    I am clueless...
    Following is my modified Prepared Statement ::
    conn.prepareStatement(("Insert into MGX (BTS_ID,MGX_Num,Port_No,FRSM_No,RPM_Card,Multi_Link,Port_Status) values (?,?,?,?,?,?,?)"));
    stmt1.setInt(1,Integer.parseInt(request.getParameter("bts1")));
    stmt1.setInt(2,Integer.parseInt(request.getParameter("allocMgxId")));
    stmt1.setInt(3,Integer.parseInt(request.getParameter("allocPortNo")));
    stmt1.setInt(4,Integer.parseInt(request.getParameter("allocFrsmSlotNo")));
    stmt1.setInt(5,Integer.parseInt(request.getParameter("allocRpmNo")));
    stmt1.setInt(6,Integer.parseInt(request.getParameter("allocMultiLinkNo")));
    stmt1.setString(7,"Allocated");
    Awaiting for a solution....

  • 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

  • ANT script genrated error: package javax.servlet does not exist

    Hi there,
    I am running ANT and confronted this message:
        [javac] Compiling 1 source file to C:\eclipseProjects\tomcat_test
        [javac] C:\eclipseProjects\tomcat_test\WEB-INF\src\WebTest.java:4: package javax.servlet does not exist
        [javac] import javax.servlet.ServletException;
        [javac] ^I googled around and found this solution:
    servlet-api.jar is the jarfile that contains javax.servlet.ServletException and javax.servlet.http.* which are imported by WebTest.java and must therefore be found in the classpath. If javac doesn't find this jar (or the javax.servlet packages), it will say (or shout, depending on my and javac's mood): [the error message]
    well...I set in the classpath the location of the servlet-api.jar
    (found at: C:\Tomcat\common\lib)
    I set it with the environment variable (windows xp)
    Just as it's shown here: http://www.cs.usask.ca/~wew036/latex/env-env.jpg
    NOTHING :-(
    could anyone assist, thanks

    Hi..seems u r new to J2ee.. dont worry its a very small problem:
    Here is the solution.. yes u have to edit the environment variables:..
    I am using J2EE sdk 1.4 and running on xp
    This is the classpath setting:
    C:\Sun\AppServer\lib\j2ee.jar;
    This is the PATH setting
    C:\Sun\AppServer\bin;
    Good Luck :)

  • Getting an error like this The import javax.servlet cannot be resolved

    HI
    i am getting an error like this "The import javax.servlet cannot be resolved".wht i ahve done in eclipse right click->open->servlet->packge name->servlet name->next->nexyt>finish.hereinterfaces is javax.servlet.Servlet.
    do i need add jar for it.can any one tell me why i got error like this.
    vijay

    Please don't doublepost. Answer is given here: http://forum.java.sun.com/thread.jspa?threadID=5220686

  • Javax.servlet.* Not Found Error - Please help

    I am having a great deal deal of trouble trying to compile a program using javax.servlet and javax.servlet.hhtp.*. I have setup the JAVA_HOME and the CLASSPATH variables as per the Installation instructions. I appear to have hit a brick wall and I am absolutely desperate to get this working. I have installed the J2EE SDK as well as the Servletapi2.1. Please Help.
    Variables:
    CLASSPATH=c:\jdk1.3\lib\tools.jar;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\jdk1.3\jre\bin;c:\jdk1.3\jre\lib;c:\mm.mysql-2.0.14\org;c:\jdk1.3\lib\servlet.jar;
    JAVA_HOME=c:\jdk1.3;
    J2EE_HOME=c:\j2sdkee1.3.1;
    PATH=%PATH%;c:\jdk1.3\bin;c:\j2sdkee1.3.1\bin;
    Error message from compiler:
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:27: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:30: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    L:\PROGRA~1\allaire\jrun\servers\default\loanstest\web-inf\classes\PasswordServlet.java:39: cannot resolve symbol
    symbol : class HttpServlet
    location: class PasswordServlet
    public class PasswordServlet extends HttpServlet

    I can only think of three suggestions.
    One, use your mouse to "cut-n-paste" the value of CLASSPATH and verify that those files are exactly where you think they are, and are spelled right.
    E.g.
    CD C:\JDK1.3\LIB
    DIR SERVLET.JAR
    Two, if they're spelled right, run "jar tvf" on the files to make sure they aren't corrupted or something.
    E.g.:
    JAR TVF SERVLET.JAR
    Three, since you're working in Windoze, try putting the value inside double quotes. E.g.:
    SET CLASSPATH="c:\jdk1.3\lib\tools.jar;c:\j2sdkee1 ... etc ... "
    If you haven't tried the above, give it a go, see what happens.

  • Error on import javax.servlet.*;

    Hi everyone,
    I am trying to compile a servlet and i receive this errors:
    C:\HAMID\JAVA>javac Welcome.java
    Welcome.java:7: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    Welcome.java:8: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    Welcome.java:10: cannot resolve symbol
    symbol : class HttpServlet
    location: class Welcome
    public class Welcome extends HttpServlet {
    ^
    Welcome.java:12: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class Welcome
    public void doGet(HttpServletRequest request,
    ^
    Welcome.java:13: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class Welcome
    HttpServletResponse response)
    ^
    Welcome.java:14: cannot resolve symbol
    symbol : class ServletException
    location: class Welcome
    throws ServletException, IOException {
    ^
    6 errors
    C:\HAMID\JAVA>
    Could you please let me know what to do?
    thanks
    Hamid

    servlet.jar is not in your classpath. You should not get this error once you include this in your classpath.

  • Javax.servlet.http.* error

    I am trying to compile a file, but got the error message "package javax.servlet.http does not exist",
    "import javax.servlet.http.*"
    It seems to me that this particular package is missing. how and where exactlly do I get this particular package and make it to work??
    thanks

    As you are using the package I assume that you're targetting a servlet engine (such as Tomcat) or a J2EE server. The package is in servlet.jar which is part of the binary release of the container that you are using.
    You can download containers from the following links:
    http://java.sun.com/products/servlet/index.html
    http://jakarta.apache.org/tomcat/index.html

  • Import javax.servlet.* gives error "package does not exist"

    I am working through Monica Pawlan's book "Essentials of Java PL".
    My PC runs Windows2000 prof. I have downloaded and installed j2sdk-1_3_1_01-win.exe in c:\jdk1.3.1_01
    I have downloaded and installed tomcat4.0 (jakarta-tomcat-4.0.zip) into c:\jakarta-tomcat-4.0
    CATALINA_HOME is set to c:\jakarta-tomcat-4.0 and CLASSPATH is set to .;C:\jakarta-tomcat-4.0\common\lib\servlet.jar
    I can compile an applet starting:
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    //Class Declaration
    class SwingUI extends JFrame implements ActionListener { ... }
    but trying to compile my servlet starting:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ExampServlet extends HttpServlet { ... }
    gives me the error (import javax.servlet.*) "package does not exist".
    Any pointers on this immediate problem? and is my book out of date?
    Many thanks,
    James Towell

    You downloaded the Java 2 SDK Standard Edition, but you need to also download the Enterprise Edition if you want to write programs that use enterprise features.

  • Error in importing javax.servlet.ServletConfig;

    Hi
    I am fairly new to servlets technology
    while importing package javax.servlet.ServletConfig; i got error Create class "ServletConfig" in package javax.servlet
    I'm using eclipse IDE

    Which project have you created in eclipse?
    Java or J2EE project?
    If its a J2EE project, the jars will be included automatically in the lib
    but if its a Java project, you will have to include the servlet-api.jar in the classpath.

  • Missing artifact javax.servlet.jsp:jsp.api:jar:2.1 Eclipse error

    When I try to UPDATE my Maven project ( Chapter 8 - Using JSP with AEM 6.0 ) after I updated my main pom.xml with the javax.servlet.jsp dependancy, I get the following error :Missing artifact javax.servlet.jsp:jsp.api:jar:2.1
    I even tried to compile from command line using mvn compile and get the same error :
    [ERROR] Failed to execute goal on project company-training-project-bundle: Could  not resolve dependencies for project com.adobe.training:company-training-project-bundle:bundle:1.0-SNAPSHOT:
    Could not find artifact javax.servlet.jsp:jsp.api:jar:2.1 in adobe (http://repo.adobe.com/nexus/content/groups/public/) -> [Help 1]
    If I look at my .m2 dir, I can see that it attempted to get the jar, but it wasn't able to grab it :

    Hi Billy,
    Try changing the URL from (http://repo.adobe.com/nexus/content/groups/public/) to (https://repo.adobe.com/nexus/content/groups/public/), i.e. add the https.
    That should do it. Let us know if it doesn't work.

  • Javax.servlet.ServletException: javax.servlet.jsp.JspException, error while doing workflow tutorial

    Hi All,
    I am getting this error at this step of tutorial. Please help.
    To apply the workflow to the Product of the Day page:
    1.Open the Product of the Day page in edit mode. If the page is still open from a previous procedure, reload it.
    2. In Sidekick, click the Workflow tab and select the Product of the Day workflow. Click Start Workflow.
    3. Open the Inbox page. (http://localhost:4502/libs/cq/workflow/content/inbox.html)
    4. Select the Step 1 item for the Product of the Day content, and click Open.The form1 page opens.
    At this step i am getting the below error.
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Error while executing script body.jsp
    Please help

    Not sure which workflow tutorial you are reffering. The stack trace in log should tell you what is exactly wrong.

  • Error:java.lang.NoSuchMethodError:javax.servlet.jsp.tagext.TagAttributeInfo

    Hi All,
    I am getting the following error when i create a jsf jsp page and build it in jdeveloper.
    Error:java.lang.NoSuchMethodError:javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
    when i build the application by simply creating jsp not jsf jsp then it works well.
    Could you any tell me how to fix this? i searched in forums but i didn't find relevant solution.
    Thanks,
    Udhaya

    Hi!
    Can you tell us what version of JDeveloper you are using, and what steps you took to create the JSF page? Like, write from scratch or use the JSF page wizard?
    Also, can you check your project properties, and check that the JSF libraries are included, and JSF tag libraries set up?
    Regards,
    Jeroen van Veldhuizen

  • Javax.servlet.jsp.JspException: Error: IOException while writing to client!

    Hi
    I have deployed a WAR file successfully on
    standalone( win os) / 10AS server Rel2 ( Linux )
    But some times I get this Error ONLY on 10AS server Rele 2
    "javax.servlet.jsp.JspException: Error: IOException while writing to client!"
    Plz can some body tell me why am i getting this error.
    Is this a J2ee Container Problem?
    with regards
    Karthik

    Hi Form
    Plz some body explain me why am i getting this error not so frequently
    with regards
    Karthik

Maybe you are looking for

  • Multiple Users

    I have multiple user accounts on one computer (in fact, they're all me but separated for work, home and various civic interests). With PowerMail, I can make every user account use the same, single mail database (on an external drive). Mail doesn't ap

  • Open item management of GL account

    Hi all I am trying to activate open item mangement indicator for my tax account for around 30 company codes. I could able to activate for all exept one company code and i am receiving the massage as "You cannot change the open item management setting

  • Changing printing preference​s in hp connected

    I want to change my printer preferences when using ePrint to send an email to my printer.  The preferences I'd like to change are printing in black & white as default and also changing to duplex as default if possible.  On another post it said you ca

  • Issue with Crystal Report Server

    Hi, I have a .Net application that uses Crystal Reports Server. The application runs from two servers through load balancing and one of them hosts RAS(Report Application Server) component as well. The issue I am facing is that the server that does no

  • Archiveing entourage emails as pdf with applescript

    Hello, I would like to archive all my emails in a flexible format that doesnt need entourage to read them. I would like to save all my emails in entourage to PDF. does anyone have a script that can do this? I can do this individaully by just selectin