JSP Caching in Tomcat

Hello, I'm using Tomcat 5.0 and I'm having problems with JSP caching.
My webapp is hosted in a remote server on which I telnet into to do my development work. At first, everything was fine, i.e. I didn't face any JSP caching problem.
However, when another developer decided to telnet into the same server to do his development work on the same webapp, we started to experience JSP caching problem.
We had to delete the content of the "work" folder and restart the server for any changes to take effect.
Does anyone know how to sort out this problem?

OK, I've found out the way to resolve this.
Basically, each developer will need to "touch" all his JSPs to make sure their JSPs get compiled.

Similar Messages

  • Problem in running a jsp page on tomcat 5.0

    hi....
    i made a java class abc.java and then compiled it to get a java class file named abc.class in a package named pkg.
    Then i copied this package in the classes folder of the WEB-INF folder in tomcat 5.0.
    After that i created a jsp page in which i imported this class file. Now when i run the jsp page on tomcat 5.0 i get an error saying this:
    javax.servlet.ServletException: pkg/abc (Unsupported major.minor version 49.0)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.UnsupportedClassVersionError: pkg/abc (Unsupported major.minor version 49.0)
         java.lang.ClassLoader.defineClass0(Native Method)
         java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1214)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
         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)
    Can anyone please tell me the solution to this problem?
    thanks

    This post:
    http://mail-archives.apache.org/mod_mbox/jakarta-tomcat-user/200408.mbox/%[email protected]ys.com%3E
    Leads me to believe that you're compiling and targeting a java version that your tomcat installation doesn't support. What version of the JDK are you using?
    Good Luck
    Lee

  • Jsp program on tomcat

    I am having trouble with a simple jsp program on tomcat. I have one Java bean class that the jsp cannot find. It is in the classes directory under WEB-INF. I have tried it with and without my web.xml file and I get the same error.
    org.apache.jasper.JasperEXception:  Unable to compile class for JSP:
    An error occurred at line: 5 in the jsp file: processFormData.jsp
    The import Inn cannot be resolved
    <%@page language="java"%>
    <%@page import="Inn"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiional//EN />"
    <jsp:useBean id="inn" scope="request" class="Inn"/>
    <jsp:setProperty name="inn" property="*" />Julie

    Thanks. I'm not sure I understand why, but that was the problem.

  • Problem on reload a JSP file in Tomcat 3.3.1

    I have a problem about Tomcat 3.3.1
    I am developing a JSP application,
    but Tomcat not recompile the JSP file after i modify it.
    I need to "wait" the tomcat recompile it, so i can see the change.
    This make the development really difficult...
    Do I miss some important step on config Tomcat 3.3.1
    how to force it to detect a newer version JSP in every request ??
    Thanks

    I believe there is a way to configure Tomcat to do this, but I don't know what it is.
    Until someone can tell you the configuration steps, here is a workaround. Tomcat keeps the Java source and class files for your JSP code somewhere under its "work" directory. Find those files and delete them, which will force it to re-compile.

  • How to see JSP compilation errors - Tomcat 4.1.18- JDK 1.4

    Hi There,
    I'm kind of new to JSP world, so once in while I forget to put a ; or I put a variable name wrong (I usualy use Eclipse to do my coding in JAVA, but the existing plugins for JSP development are still in their early stages, so there's isn't any plugin that indicates errors on JSP before deploying them).
    When I try to see a JSP, if it has an error (compilation-time error), I get this message:
    <--->
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    <--->
    This doesn't help me a lot to fix the problem, I would like to, at least, see from what line the error came from.
    Help anyone?
    Thank You
    Pinho

    This kind of errors often come from syntax error in
    the jsp page.
    Tomcat is not very friendly with this kind of errors.
    A trick is to open the java file under the 'work'
    directory and checkIsn't there any way to show the error on a page, just like a run-time error?
    Maybe changing some log setting?

  • How to use debug my jdevloper devloped jsp applications using tomcat 4.0?

    hello,
    how to use debug my jdevloper devloped jsp applications using tomcat 4.0?
    how to run with using tomcat path with browser?
    can any one help?
    thanks
    pullareddy

    Hi Pullareddy,
    Charles' answer will work for Servlets in Tomcat, but debugging JSPs is a bit more complicated than debugging Servlets.
    Here's what you need to do:
    (I don't have Tomcat, so I don't know the details of Tomcat configuration files and I can't guarentee that Tomcat provides the flexibility so that you can configure it for debugging JSPs. Each application server is configured a bit differently. Hopefully you can adjust the following instructions to Tomcat.)
    1. You need to replace Tomcat's JSP engine with OJSP and you need to setup debugging parameters for OJSP.
    This is not specifically in the JDev documentation, but you may be able to apply the information found in the topic "Remote Debugging in OC4J".
    Here are some tips:
    A. You'll probably need to specify the following jars in some Tomcat config file: ojsp.jar, ojsputil.jar, xmlparserv2.jar, ojc.jar, and jdev-rt.jar.
    B. The OJSP class name is oracle.jsp.runtimev2.JspServlet.
    C. The debug parameters are:
    debug_mode = true
    developer_mode = true
    encode_to_java = true
    emit_debuginfo = true
    jspjavacompiler = oracle.jdevimpl.jsp.JspOjcCompiler
    2. You need to make Tomcat start the Java command with debugging options. (This is what Charles was talking about. One of the debug options is -XXdebug). This is in the JDev documentation in the topic "Starting a Java Process in Debug Mode". Please read that documentation help topic.
    3. You need to delete any old .java or .class files which were created in the past for your JSP. If you leave old .java or .class files around, then the debugger may not be able to stop at breakpoints in your JSPs. So, be sure to clean up old files.
    4. Set your project settings for remote debugging. This is on the Debugger - Remote panel in the Project Settings dialog box. You probably want either Attach to OJVM or Attach to JPDA. Which radio button you choose depends on what command line options you specified in step 2.
    -Liz

  • How to call EJB deployed on websphere from JSP running on Tomcat?

    I am trying to establish communication between two app servers. I have a sample EJB deployed on Websphere and wish to call its business methods from a JSP page which is running on Apache Tomcat server. (ie) Tomcat is client to websphere. Is it possible to do? If so, what are the client Jar files of websphere that I should make available to JSP page on Tomcat? Do I need to set any Jars in Tomcat environment variables? Lood forward for your immediate help. Thanks in advance

    Please see the thread
    http://forum.java.sun.com/thread.jspa?threadID=514536.
    Hope that helps..

  • Use of xml syntax for jsp's in tomcat 4.0.1?

    hi,
    i am playing around with jsp's on tomcat 4.0.1. when i use xml tags in my jsp's, it appears that tomcat ignores them, eg:
    <jsp:scriptlet>
    code
    </jsp:scriptlet>
    Tomcat does not seem to be running the code - it just prints it out on the screen.
    If I use
    <%
    code
    %>
    it works fine. This also seems to happen for other XML tags, such as <jsp:directive.page>
    Does Tomcat support JSP documents (ie: where all jsp tags are XML?). If it's Servlet 2.3 compliant, I figured it would have to.
    Perhaps I am just doing something foolish?
    Guidance is appreciated.
    Thanks,
    Steve

    Not anything definitive, although a colleague told me that apparenlty not all tags were supported by Tomcat. I suppose there are a few options such as looking at the Jasper source code.
    Steve

  • JSP caching

    Hi,
              is it possible to enable JSP caching on the server side?
              with this I mean, let's say that an user make a jsp request to the server,
              the server invoke the requested jsp/servlet by the user, the JSP/servlet
              then connect to a database (via EJB) and get the requested data.
              Finally the server send then the response back to the client. (everybody
              happy :-) )
              The second time, the same user make another JSP request to server
              containing the same "get" or "post" data as in the first time in the http
              request.
              Ok here is when my question comes: does the application server notice this
              similarity in the http request header? or does the server just make another
              request to the
              JSP/servlet?
              Thank you,
              Rob
              

    There is a new caching feature in the next SP.
              No, servers don't assume that an identical request gets an identical
              response, although more and more app servers are building in caching
              support. Silverstream for example has pretty good caching support, and WL
              should soon.
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Rob" <[email protected]> wrote in message
              news:[email protected]..
              > Hi,
              >
              > is it possible to enable JSP caching on the server side?
              >
              > with this I mean, let's say that an user make a jsp request to the server,
              > the server invoke the requested jsp/servlet by the user, the JSP/servlet
              > then connect to a database (via EJB) and get the requested data.
              > Finally the server send then the response back to the client. (everybody
              > happy :-) )
              >
              > The second time, the same user make another JSP request to server
              > containing the same "get" or "post" data as in the first time in the http
              > request.
              > Ok here is when my question comes: does the application server notice this
              > similarity in the http request header? or does the server just make
              another
              > request to the
              > JSP/servlet?
              >
              > Thank you,
              >
              > Rob
              >
              >
              >
              

  • View JSP Examples in Tomcat 4

    Hello everyone,
    I will really appreciate your advise on this problem.
    I am not able to run the JSP examples in Tomcat 4. I can see that the document sais:
    These examples will only work when these pages are being served by the ServletRunner. They will not work if you are viewing these pages via a "file://..." URL.
    But I don't know what does that mean. What should I do? How can I view these examples?
    Thank you very much for any advise and for your time.
    Martin

    >
    Normally JSP pages will be executed at server side
    e before serving
    the output to client. But you can see the same file
    using any editor
    or using windows explorer.i.e you are directly viewing
    the jsp page.
    here you are using file protocol. But when you access
    the same page
    using any browser by specifying it's URL for ex:
    http://localhost:8080/myjsp.jsp
    you are using http as protocol to get the required
    page/file.
    Gayam.Srinivasa ReddyHello ,
    My problem is that when I start Tomcat and type in my browser:
    http://localhost:8080/examples/jsp/index.html
    I see the JSP examples. But when I try to click on one of them,
    I get an error like this:
    http://localhost:8080/examples/jsp/num/numguess.jsp
    Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214).......
    ....and so on...........
    root cause
    java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava/util/Set;
         at org.apache.jasper.compiler.TldLocationsCache.processJars(TldLocationsCache.java:202)
         at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:139)
         at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:345)
         at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
    ....................and so on
    Please give me a hint of how to fix this problem.
    Thank you very much for your time and advise!
    Martin
         

  • How kill the server cache of tomcat

    I' ve this horrible problem with the cache of tomcat and any time I have to clean the temporary folders and closing the browser.
    Is there an option to eliminate server cache??
    Please help

    could you describe your problem a little bit closer? i also use tomcat and never had problems with caching so i wonder what the problem could be (and maybe find a way to solve it..)

  • JSP caching on Apache

    Hi,
    We are getting inconsistent caching of our JSP's on APACHE.
    Here is a sample response header.
    HTTP/1.1 200 OK
    Date: Fri, 04 Mar 2005 11:57:16 GMT
    Server: Apache Tomcat/4.0.1 (HTTP/1.1 Connector)
    Content-Type: text/html; charset=utf-8
    Cache-Control: max-age=7200, must-revalidate
    Last-Modified: Fri, 04 Mar 2005 11:53:45 GMT
    Expires: Fri, 04 Mar 2005 13:53:45 GMT
    Content-Length: 22396
    Age: 1073
    I would expect the JSP to expire after two hours but Apache seems to randomly expire the page after 2-50 minutes.
    Here are our APache cache settings :-
    CacheRoot               /cache               
    CacheSize               15000000
    CacheGcInterval               4
    CacheMaxExpire          24
    CacheLastModifiedFactor     1
    CacheDefaultExpire          24
    CacheDirLevels               not set
    CacheDirLength               not set
    CacheNegotiatedDocs          on
    NoCache               not set
    Any help/suggestions much appreciated.

    Make sure you only have one instance of PageContext in your classpath.
    Check all the jars in your classpath. I know that orion.jar has an instance of PageContext that you should remove.

  • 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?

  • Error when run a jsp page in tomcat

    I carefully follow all instruction to install and config j2sdk1.4.2 and Apache Tomcat/5.0.28. After completing, I can run all sample applications about JSP and Servlet in Tomcat manager. I also test my own servlet application and it also works.
    But I fail to run a very simple jsp page. Although I already set environment variables such as CATALINA_HOME, JAVA_HOME, CLASSPATH as directed but it seem to not be able to compile jsp page.
    ( I can compile other java classes in command line. )
    Below is the error i receive . This error takes me lots of time to consider.
    I look for your help ( please describe as clear as goog ). Thanks a lot.
    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)

    If you are sure you've installed the JDK (as opposed to just a JRE, which doesn't come with the compilation tools that are required to compile JSPs), then your JAVA_HOME is probably set incorrectly. Ensure JAVA_HOME is pointing to the JDK directory, and not to the JRE directory.

Maybe you are looking for