Unable to run JSP file in TOmcat

My Tomcat is running when i type http://localhost:8080/index.jsp , i'm able to see home page
CLASSPATH=C:\j2sdk1.4.2_08\bin;E:\Grinder;E:\Grinder\lib\grinder.jar;C:\Program Files\Java\j2re1.4.2_08\lib\grinder.jar;
JAVA_HOME=C:\j2sdk1.4.2_08
I tried both pointing to JAVA_HOME C:\Program Files\Java\j2re1.4.2_08
When i try to run the JSP file under C:\Tomcat 5.0\webapps\ROOT\add.jsp. I'm getting following error.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
     org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
     org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
     org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
     org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
     org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
     org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
     org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I know the same.
But problem is that whenever I am creating a new file containing single line say 'Hello world' and then try to run,
the similar type of error msg comes.

Similar Messages

  • Unable to run jsp in tomcat 5.0

    hi ,
    iam unable to run jsps in tomcat 5.0.
    i get an error saying ,unable to compile java compiler
    iam able to compile servlets & execute them.
    i have already set the paths for JAVA_HOME & CATALINA_HOME
    please guide me accordingly
    regards ,
    shailesh

    the same code gets executed in other system in which there is only one jdk.
    the system which iam using has got many jre s due to
    1) netbeans IDE
    2)Weblogic server
    3) jdk 1.4 was previously installed
    4) jdk 1.5 was also installed
    but i have set JAVA_HOME   =jdk1.6
    I doubt the compiler is trying to compile itself or another compiler
    regards ,
    shaileshkumar

  • Error in running JSP files

    Hi,
    This is the first time I post message on the forum. The problem is that when I run the JSP files with Tomcat 4.0.1. It give the error messages. But I have put the class files under the root, such as ...\WEB-INF\classes, however, it doesn't work. Also I have set the classpath for tomcat. Is there any step I have missed?
    Please give me some solution as the problem has annoyed me for a long time.
    The error message is:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:56: Class org.apache.jsp.DBSession not found.
    DBSession sess = null;
    ^
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:59: Class org.apache.jsp.DBSession not found.
    sess= (DBSession)
    ^
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:64: Class org.apache.jsp.DBSession not found.
    sess = (DBSession) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "DBSession");
    ^
    3 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)

    Confused yet.
    Here's the deal. Every Java class is in a package. If it is not declared the it is the default package but the default package is based on the directory it is in.
    The DBSession class is in WEB-INF/classes and the jsp gets compiled into a class file that is placed in a different directory. Since the two class files are in different directories they are in different default packages. Thus the import.
    Most people don't run into this because they put their tags into packages and import the packages.
    To make everybody happy, put your tag in a package, recompile it and then import the package.

  • In which folder should i save my jsp file in tomcat

    Hi,
    Actually i have installed j2sdk1.4 as well as Apache tomcat 4.1.2 version. Now i m very confused that in which directory should i save my JSP files to run the files in tomcat.
    If possible pls give me alternate options also.I'll be highly thankful to u.Also is it needed to configure tomcat?
    In waiting
    thanx
    Jassi

    as far as i know, jsp can go anywhere in your webserver directory. if installed correctly that is. its like php, if u know anything about that.

  • Unable to open jsp file in Design mode

    Hi,
    I am unable to open jsp files in design mode, I am using eclipse Version: 3.6.1.
    Please help.
    Regards,
    Ale Hasan

    Hi Ale,
    Thank you for the additional information. Unfortunately, there does not seem to be anything unusual about your project based on your description. I'm surprised you don't see any processes listed in the process view while waiting for the page to open. I thought you might see something related to a queue manager job to "Manage Resource Event Jobs".
    Are there any messages in the error.log? You can open a view to the error log from the menu option, "Window -> Show View -> Error Log". I'm curious if there are any messages about a process timing out, unable to reset some object within a certain time, or any exceptions logged.
    If you change to another workspace with just a single JSF web project containing a smaller number of JSP, do you experience the same behavior?
    Can you also try using a more recent release of OEPE to see if that helps? The 11.1.1.6.1 release is about a year old.
    http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html
    Kind regards,
    Carlin

  • Unable to run batch files in my EP server

    Hi,
       I'am unable to run batch files(go.bat and configtool.bat) on my EP server.Anbody please give me a solution.
    With Regards
    Pradeep.B

    If your EP Server is on non-windows based environment then you cannot use go.bat & configtool.bat or else you can. If you are trying to execute these on unix based machines then you have to use go.sh & configtool.sh files.
    Pradeep

  • I am unable to run flash files, I get an AIR error.

    I get this Adobe AIR error: " This installation of this application is damaged. Try re-installing or contacting the publisher for assistance." I have reistalled AIR 3.3 and still am unable to run flash files.

    Shah Shah wrote:
    The idea is once my iPhone is paired with the MBP via bluetooth...
    No it's not. Read the description of the application:
    "Bluetooth: Tokenlock can monitor any Bluetooth device to check if it is removed from range, such as your cellphone or a headset. Token lock checks periodically based on a schedule you choose to see if the Bluetooth device can still be seen. You can set different schedules based on whether or not your computer is plugged into power or is simply on battery to conserve battery power. The device does not have to be paired with your computer, allowing you to use just about any Bluetooth device - not just those that the computer supports."

  • Unable to run batch file through BO XI 3.1 server

    IHi,
    I am unable to run batch file (.bat) from BO XI CMC. the batch file is running fine through command prompt but fails at server. Error msg is "Running this type of program is disabled by your administrator".
    Can you help?
    Thanks in advance,
    Avijit

    Have your administrator enabled the running of that type of program in the CMC?
    Sincerely,
    Ted Ueda

  • Not able to run a JSP file in Tomcat 5.5

    Hello friends i am new to JSP programming.
    I recently designed a application to enter values of certain field in a database (Using SQL Server Database)
    i used a file name Register.jsp, so when the action is performed by clicking submit button it use to call another file named Register_DB.jsp in which database insertion is performed this 2nd file includes another .java file which is actually creating the JDBC ODBC connection drivers
    but whenever i use to run the programme using tomcat-5.5 i use to get certain error as below ------------------->
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to load class for JSP
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: org.apache.jsp.Registration_jsp
         java.net.URLClassLoader$1.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(Unknown Source)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9***********************************************************************************************************
    So can anybody tell me what should i do to resolve this error
    here is the code what i have written
    File Name Registration.jsp
    <!--     *****     File Name Test.jsp     *****     -->
    <%@ import="Login.connectionBean" %>
    <%@ language="java" %>
    <%@ import="java.io.*" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
    <!-- DW6 -->
         <head>
              <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
              <title>Registration Form</title>
         </head>
         <body>
              <form name="Test" action="Registration_DB.jsp" method="get">
                   <table width="100%" border="0">
                     <tr>
                        <td colspan="5"></td>
                     </tr>
                     <tr>
                        <td width="10%" height="250"></td>
                        <td width="90%" colspan="4"><div align="center">
                          <table width="437" border="1">
                               <tr>
                                  <td><div align="center">User ID </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                         <input name="User_ID" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td width="149"><div align="center">User name </div></td>
                                  <td width="27"> </td>
                                  <td width="239"><div align="center">
                                       <input name="User_Name" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">Password</div></td>
                                  <td> </td>
                                  <td><div align="center">
                                        <input name="Password" type="text" size="25" maxlength="25" />
                                       </div>
                                  </td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">
                                    <input name="Button_Reset" type="reset" value="Reset Fields" />
                                  </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                       <input name="Button_Submit" type="reset" value="Submit Details" />
                                                   <%
              String User_Id=request.getParameter("User_Id")
              String User_Name="";
              String Password="";
              %>
              <%
              try
              sq.connect();
              if(user_Id!==null && User_Id!="")
              ResultSet rs2.sq.execQuery("select User_Name FROM User_Login where User_Id='"+User_Id+"'");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
              %>
                                       </div></td>
                               </tr>
                               </table>
                        </div></td>
                     </tr>
                   </table>
              </form>
         </body>
    </html>***********************************************************************************************************
    File Name Registration_DB.jsp
    <!--     *****     File Name Test_DB.jsp     *****     -->
    <%@ language="java" %>
    <%@ import="Login.connectionBean" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <%@ import="java.io.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
         <head>
              <title>Untitled Document</title>
         </head>
    <body>     
              <%
              String Button_Submit = request.getParameter("Button_Submit");
              String User_Id = request.getParameter("User_Id");
              String User_Name = request.getParameter("User_Name");
              String Password = request.getParameter("Password");
              %>
              <%!
              ResultSet rs1=null;
              ResultSet rs2=null;
              %>
              <%
              try
                   sq.connect();
                   if(Button_Submit!=null && Button_Submit!="")
                        String qry="INSERT INTO User_Login (User_Id, User_Name, Password) VALUES('"+User_Id+"','"+User_Name+"','"+Password+"')";
                        int i=sq.executeUpdae(qry);
                        if (i>0)
                             response.sendRedirect("Registration.jsp");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
    %>
         </body>
    </html>***********************************************************************************************************
    File name connectionBean.java
    package Login;
    import java.sql.*;
    public class connectionBean
         private Connection con;
         public connectionBean()
              super();
         public boolean connect() throws ClassNotFoundException, SQLException
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               con=DriverManager.getConnection("jdbc:odbc:JAVA"," "," ");
               return true;
         public void close() throws SQLException
              con.close();
         public ResultSet execQuery(String qry) throws SQLException
              Statement stmt=con.createStatement();
              ResultSet rs=stmt.executeQuery(qry);
              return(rs==null)?null:rs;
         public int execUpdae(String qry) throws SQLException
              Statement stmt=con.createStatement();
              int i=stmt.executeUpdate(qry);
              return(i==0)?0:i;
    }

    hi
    here the problem is tat the server culdnt find the class for u page,
    check u hav deployed it properly or not,
    check the tomcat installation and is it working fine,
    regards
    venkat

  • How to run jsp file in Apache Tomcat 5.0?

    hi,
    i'm using jdk1.5,jsp1.2 & Apache Tomcat 5.0 as a web server.in my application i have 2 jsp files,1 html file & 1 javabean class.where i must place the html,jsp files and the .java file & .class file for a bean class.how to run this application.
    bean class:
    public class Userdata {
    private String username;
    private String email;
    private int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    getname.html file:
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="Savename.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    savename.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>
    nextpage.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    refer these source code and plz,give the result at the earliest.
    whether i want to write a web.xml file for this jsp file.
    if yes,means plz present the web.xml file for this application.
    plz,if anybody knows give me detailed description for this application.

    create a dir under webapps dir
    place your .html and .jsp files here
    also create WEB-INF dir here
    Under WEB-INF create classes and lib dir
    under classes dir put your .class file
    You also need to put web.xml under your WEB-INF dir.
    You ca keep your java file any where u want on your computer.

  • Problems running jsp files with tags on tomcat 4.0

    hi,
    i had some jsp1.1 stuff running on tomcat3.3.
    last week i moved to tomcat 4.0 , changed the tags to fit jsp1.2 and... everything is wrong now. while trying to run jsp with tags i get an error message (same for all files):
    ---->
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: (class: org/apache/jsp/djsp$jsp, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse; )V) Incompatible object argument for function call
    <-------
    the jsp files with no tags and servlets are running ok.
    I NEED YOUR HELP!!!

    cyclid,
    i have the same environment setup and the same troubles. after searching the forums, it seems that there are others with the same, if not similar issues, yet no solutions. if you find the solution to this one, could you please post it. i would really appreciate it since i have been on this one for several days with no success. i even tried the helloworld jsp/custom tag examples from a jsp profession book that i have and that won't work.
    Anyone out there,
    if you have any idea why this problem exists, any solutions, ideas would be appreciated.
    thank you,
    navesink

  • Unable to compile .jsp files with Jakarta Tomcat 5.5.3

    Hello,
    I am unable to reflect the changes that I am making in my .jsp files on my server. I am using Fedora core 4. It's like the .jsp files are not being compiled anymore. Please help! I would greatly appreciate any feedback. Thanks for your time.

    Thanks for your reply. My .jsp files where working just fine before I changed the layout of the output. Even making changes to a simple file that contains: <% out.println("Welcome to the jsp page!"); %> to the following: <% out.println("Welcome to the jsp page! Today is the day!"); %> does not work. I have cleared the browser by deleting all cookies, temp files, history, etc. The changes to my file are not being compiled. I thought that in JSP 2.0 changes to your files where compiled automatically. Am I missing something? Please help!

  • Getting error when placing jsp file in tomcat root folder

    hello experts,
    i have developed an application on netbeans 6.1 for mail.
    It is working perfect when i run it from netbeans, but when we copy those jsp files to ROOT folder of tomcat5.5 server, it is showing me following error.
    rg.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 14 in the jsp file: /Mailer1.jsp
    Session cannot be resolved to a type
    11: <%!
    12: String nam = null, email = null, suggestion = null;
    13: RequestDispatcher disp = null;
    14: public static Session sess = null;
    15:
    16: %>
    17: <%
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    Session cannot be resolved
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    javax.mail.Authenticator cannot be resolved to a type
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 45 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    42: return new PasswordAuthentication("[email protected]","ratatouille");
    43: }
    44: });
    45: sess.setDebug(true);
    46:
    47:
    48: //sess = Session.getDefaultInstance(props);
    An error occurred at line: 50 in the jsp file: /Mailer1.jsp
    Transport cannot be resolved to a type
    47:
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    An error occurred at line: 50 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    47:
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    Message cannot be resolved to a type
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    MimeMessage cannot be resolved to a type
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 52 in the jsp file: /Mailer1.jsp
    Message.RecipientType.TO cannot be resolved to a type
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    An error occurred at line: 52 in the jsp file: /Mailer1.jsp
    InternetAddress cannot be resolved to a type
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    An error occurred at line: 53 in the jsp file: /Mailer1.jsp
    InternetAddress cannot be resolved to a type
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    56: trans.connect();
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    i m unable to find out the solution,
    please help me to resolve it.
    thnaks.

    Hi shams.hq,
    I don't understand how you bother to copy an application in your server directories. It's really piece of cake to deploy with Tomcat.
    All you have to do :
    - with Netbeans, you build the project : a WAR file will be created in the dist directory of your project;
    - launch the server, if it's not running;
    - with your web browser, connect to the Tomcat Manager;
    - from there, you may upload and deploy the WAR file of your project.
    Et voilà ! Tomcat will unzip the WAR and install your classes and libraries at the right place.

  • Error while running JSP's on tomcat 4.1.18- org.apache.jasper.JasperExcepti

    I am getting the following error when I compile the JSP page. I have set my CLASSPATH correctly, still I am getting the error.Where should I place my class file???
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 0 in the jsp file: /JspSession_NextPage.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    D:\Program Files\jakarta-tomcat-4.1.18-LE-jdk14\work\Standalone\localhost\_\JspSession_NextPage_jsp.java:41: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.JspSession_NextPage_jsp
    UserData user = null;
    ^
    An error occurred at line: 0 in the jsp file: /JspSession_NextPage.jsp
    Generated servlet error:
    D:\Program Files\jakarta-tomcat-4.1.18-LE-jdk14\work\Standalone\localhost\_\JspSession_NextPage_jsp.java:43: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.JspSession_NextPage_jsp
    user = (UserData) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
    ^
    An error occurred at line: 0 in the jsp file: /JspSession_NextPage.jsp
    Generated servlet error:
    D:\Program Files\jakarta-tomcat-4.1.18-LE-jdk14\work\Standalone\localhost\_\JspSession_NextPage_jsp.java:46: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.JspSession_NextPage_jsp
    user = (UserData) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "UserData");
    ^
    3 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.18-LE-jdk14

    Have you placed the UserData class in the same directory?

  • How to reference a DatabaseHandler servlet class from a jsp file in Tomcat

    Trying to create a database connection in the jsp file in webapps\project folder by referencing the DatabaseHandler class in webapps\project\WEB-INF\classes.
    Here is the code in the jsp to make the connection:
    DatabaseHandler db = new DatabaseHandler() ;
    String sql = "SELECT password FROM cms_users WHERE user =" + userName ;
    java.sql.ResultSet rs = db . selectQuery( sql ) ;
    Here is the DatabaseHandler class:
    import java.sql.*;
    public class DatabaseHandler
         // instance variables - replace the example below with your own
    private Connection connection;
         * Constructor for objects of class DatabaseHandler
         public DatabaseHandler()
    String url = "jdbc:odbc:javadatabase";
    // Load the driver to allow connection to the database
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    connection = DriverManager.getConnection( url );
    catch ( ClassNotFoundException cnfex )
    System.err.println( "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    System.exit( 1 ); // terminate program
    catch ( SQLException sqlex )
    System.err.println( "Unable to connect" );
    sqlex.printStackTrace();
    public ResultSet selectQuery( String query )
    Statement statement;
    ResultSet resultSet = null ;
    try
    statement = connection.createStatement();
    resultSet = statement.executeQuery( query );
    catch ( SQLException sqlex )
    sqlex.printStackTrace();
    System . exit( 1 ) ;
    return resultSet ;
    Here is the error i am getting when i try to run the jsp script:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /ValidateLogon.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cms\ValidateLogon_jsp.java:47: cannot find symbol
    symbol : class DatabaseHandler
    location: class org.apache.jsp.ValidateLogon_jsp
    DatabaseHandler db = new DatabaseHandler() ;
    ^

    Just like in the class file you need to import any classes that you want to access in the JSP.
    http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html

Maybe you are looking for

  • "File not Found" error in the admin console for dimension

    Hi All, We are onto the BPC7 MS version and recently we have started facing an error "File Not Found" while trying to access the dimension members from the admin console. I have checked the "adminapp" folder where all the dimension files should be pl

  • Calendar does not sync from Device to Outlook

    I am using a BB Style with MS Outlook. We do not have BES so I sync with a wire. I have set BB Desktop Manager to sync both ways but the calendar only syncs one way. Events I add to my device calendar do not sync to my desktop. Any ideas?

  • Problems to join a virtual machine on Domain.

    Hi Everybody Im trying to join my windows 8 virtual machine on a Domain mounted in Windows server 2012, but I.m not able to do it, when I try, i receive the below message. Note: This information is intended for a network administrator.  If you are no

  • How much Ram do I need in a MacBook Pro for Software Engineering?

    I plan to buy a new MacBook Pro in the next month for school and hopefully for work. I would like this computer to get me at least 4 years of use. I will be majoring in software engineering. My question is how much ram would I need in a Macbook Pro f

  • Add hours to time stamp

    Hi , I have to add hours to my time stamp control. I unbundle the time stamp cluster and get the hours, minutes, seconds , days.. To the hours , i want to add hour. If i add an hour less than 12, i get correct output, BUt hour greter than 12, Time st