Can't compile jsp

Hello all.
I've searched this forum for four hours,
I tried many suggestions but still there is no answer to my problem !
I recently developed a website.
In a form that I have in my jsp, stepOne.jsp,
the user need to choose a username.
His input goes to servlet, "StepOneServlet.class".
If the user selected a new username (that not appear in the database)
he will be redirected to stepTwo.jsp.
If the specific username already exist, the user will be redirected to
message.jsp.
According to the address bar in my browser, the redirections work fine,
and there is no database problem.
My only problem is :
In both cases I'm getting the same error page !!!!!!
When I'm being redirect to message.jsp, I get the page :
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
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
     org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
     org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:818)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.message_jsp._jspService(message_jsp.java:73)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
When I'm being redirect to stepTwo.jsp, I get the page :
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
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
     org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
     org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:818)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.stepTwo_jsp._jspService(stepTwo_jsp.java:99)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
1) I deleted the folder ...\Tomcat 5.5\work many times.
2) In line 99 (stepTwo_jsp.java) it says :
if (_jspx_page_context != null) jspxpage_context.handlePageException(t);
3) In line 73 (message_jsp) it says :
if (_jspx_page_context != null) jspxpage_context.handlePageException(t);
I'm now transforming my project from netbeans to tomcat only.
With netbeans - there are no errors.
Thank you for your time....
waiting for your replays.

I am getting same error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.NullPointerException
     org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
     org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:818)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.doLogin_jsp._jspService(doLogin_jsp.java:228)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
Apache Tomcat/5.5 I am running server with mysql database on a linux machine and this error happens every morning but when I restart the tomcat process it just disappears until next morning, seems it is fine as long as it used constantly.
Has anyone got an idea what is it?

Similar Messages

  • Standalone OC4J can't compile JSPs?

    I've been following this tutorial: http://www.eclipse.org/webtools/community/tutorials/OracleServerAdapter/OracleServerAdapter.html
    in order to get my Eclipse working with my 10.1.3 standalone OC4J server.
    However, every time I try to run the index.jsp page, I get the following error:
    J2EE JSP0008 Unable to dispatch JSP Page : Exception:oracle.jsp.provider.JspCompileException: <H3>Errors compiling:C:\ORACLE\oc4j\j2ee\home\application-deployments\DemoOC4J\DemoOC4J\persistence\_pages\\_index.java</H3><pre></pre>
    I imagine that there's some sort of java path error of some sort but I can't seem to figure out what it would be. I have my JAVA_HOME set to my JDK 1.5 . ( \jdk1.5.0_11 ). Any ideas or pointers as to what I need to do to get this thing going?
    Thanks

    After digging for days, I found this thread:
    OC4J Preview - JSP not problem
    Turns out that Eclipse set it's Java library defaults to the JRE directory and not the JDK. After changing it to the JDK, I've got JSP compilation success!

  • Can u Compile JSP into a Servlet?

    Hey,
    I've heard of 'compliling jsp into a servlet.' I'm not sure if this is just reffering to the fact that the jsp/servlet engine does this on the fly when serving a jsp request or if one can actully obtain a .java file out of the jsp without doing it by hand.
    If so, how do you do this??
    THANKS!
    THABARREN

    look in Tomcat's /bin directory for a script called jspc.bat (or jspc.sh) - this can be used from a command line to convert a JSP to a servlet and compile it.
    Alternatively, the web server will have a "working" directory where it puts the servlet files it creates from JSPs (in Tomcat's case it's the "/work" directory). - just look in there after the JSP has been requested by a client.

  • Embedded Tomcat Can't Compile JSP from JAR

    I've got a problem that I can't seem to figure out. I hope someone might shed some light on this.
    I have a desktop java application that has Tomcat embedded in it. I'm creating a jar file of just myapp's *.class files and I specify the main-class and classpath in the manifest file. If I execute the jar the following way, it works fine:
    set CLASS_PATH=.;.\myapp.jar;.........all of the required Tomcat classes....;.\lib\anotherLib.jar
    javaw -ea -classpath  %CLASS_PATH%  com.myapp.Application
    But if I try to execute it this way, it runs and starts Tomcat. However, when Tomcat tries to compile a JSP, it can't find packages such as javax.servlet, javax.servlet.jsp, org.apache.jasper.runtime, and so forth.
    I believe It has something to do with the classpath. Does anybody have any ideas?

    i guess it is not the too lengthy classpath...
    just chek that when u run the application from eclipse.. r u seting the classpath.. and that classpath should not have any spaces in it..
    for ex: a directory like c:\program files \ should be as c:\progra~1\..
    ot any jar file in the classpath has spaces...
    this may be one of the reason that the classpath gets truncated...

  • Tomcat can't compile JSP

    Hi,
    I'm using Ecliple 2.1 with JBOSS 3.2.2 and Tomcat 4.1.24 on XP
    I can separately run JBOSS+Tomcat from command prompt, but when i start them from Eclipse, Tomcat fails to compile very first JSP. (Internal error). From examining error stack trace i see that tomcat tries to create process "javac.exe" with too lengthy classpath. It seems that the classpath is getting truncated.
    Has anybody had similar problem?
    Thanks in advance,
    Leonid.

    i guess it is not the too lengthy classpath...
    just chek that when u run the application from eclipse.. r u seting the classpath.. and that classpath should not have any spaces in it..
    for ex: a directory like c:\program files \ should be as c:\progra~1\..
    ot any jar file in the classpath has spaces...
    this may be one of the reason that the classpath gets truncated...

  • Can't compile JSPs with Forte 4

    I upgraded to forte 4 CE. Now I cannot compile my JSP's because they are not finding my class files.
    They all worked in Forte 3 ce.
    If I have class MyClass()
    and try to create an instance in my JSP
    MyClass mc = new MyClass()
    It gives the 'cannot resolve symbol' error on MyClass object.
    What happened? I haven't changed anything. I have about 10 jsps and a bunch of Classes that all worked and now don't.
    I checked the product support for Forte and couldn't find anything.
    If anybody else had this problem and figured it out please post your solution.
    Thanks.
    -chiranjp

    i am having the same problem using my "homemade" class with forte.
    I have all of the .java and .class files and even have a .jar file but it still cannot find them
    could you please give me more details on how you reached your solution?
    where did you place the files so that forte found them?
    any and all help is greatly appreciated.
    thanks
    -j

  • Can't compile jsp under sun application server

    im trying to make my first web app using sun java system application server and the server says that cant find "tools.jar" and it give me some explanation of the issue, but i cant solve it. i was in the same trouble when using tomcat but i could solve the problem copying tools.jar under the common/lib tomcat's directory, but under sun java system application server where do i have to copy that archive??, is it necesary??
    thanks for your help!!...

    You have to put it in the classpath of the webserver if it's anything like IPlanet.
    You need admin permissions for that.

  • Compile JSP in JCreator

    Hi,
    First of all, Can I compile JSP in JCreator? If yes, what configuration do I need to make with Java compiler.
    At moment, I have JCreator V4.0Pro installed. It does not compile my JSP files at all.
    Thanks
    Song

    hai..
    first you have create web project
    there you have to create new jsp file ..
    view help in jcreater there you can find the demo how to create a web project and deploy it...
    here are some sites where you get some idea for web project structure
    http://csjava.occ.cccd.edu/java-setup/jcreator.html
    http://www.cutthebull.com/jsp.html
    bye priya

  • Can not compile the jsp in Tomcat 4

    Hello anyone
    Now I use jdk1.4 and Tomcat 4.0.4, and put in the directory d:\j2sdk and d:\tomcat. Even I set the classpath as follow, I still compile jsp.
    SET CLASSPATH=.;D:\j2sdk\lib\tools.jar;D:\tomcat\common\lib\servlet.jar
    but at before, i can run it at Tomcat 3.2.
    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
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    D:\tomcat\work\Standalone\localhost\_\userCounter$jsp.java:4: Class or interface declaration expected.
    import javax.servlet.*;
    ^
    D:\tomcat\work\Standalone\localhost\_\userCounter$jsp.java:10: Superclass org.apache.jsp.HttpJspBase of class org.apache.jsp.userCounter$jsp not found.
    public class userCounter$jsp extends HttpJspBase {
    ^
    2 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         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:190)
         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:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         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:468)
         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:174)
         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:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)
    pls help, thank you very much!

    This is a new problem with jdk1.4 when compiling with tomcat.
    The solution is to ensure that any classes in WEB-INF/classes are in a package structure and the relevant jsp calls the same using the package name.
    best
    kev

  • Where can I find compiled JSP?

    is this a FAQ?
              when I drop a jsp into the web app docroot, I invoke it and it works.
              Where can I find the compiled .class file for this JSP? Also, it is
              possible to specify to weblogic to preserve the Java source also?
              in v70, I recall the compiled JSPs being put into a temp directory. I
              haven't found that temp in my v81b install.
              Thanks,
              -Dino
              

    If you just drop jsp into the running webapp, the classfiles go into
              $SERVER/.wlnotdelete
              For example on my box:
              ./myserver/.wlnotdelete/extract/myserver_simpleEAR_web/jsp_servlet/__bar.cla
              ss
              Muthu is correct about the snippet to make the server "keep" the .java
              files, you can also turn this on in the console under webapp --> Descriptor.
              Cheers
              mbg
              "Muthu" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi dino,
              >
              > Normally the java source files generated will be deleted after
              compilation. If
              > u want to keep the java source code files u have to specify the following
              tag
              > in the weblogic.xml
              >
              > <jsp-descriptor>
              > <jsp-param>
              > <param-name>keepgenerated</param-name>
              > <param-value>true</param-value>
              > </jsp-param>
              > </jsp-descriptor>
              >
              > --Muthu
              >
              > "dc" <[email protected]> wrote:
              > >is this a FAQ?
              > >
              > >when I drop a jsp into the web app docroot, I invoke it and it works.
              > >Where can I find the compiled .class file for this JSP? Also, it is
              > >possible to specify to weblogic to preserve the Java source also?
              > >
              > >in v70, I recall the compiled JSPs being put into a temp directory.
              > >I
              > >haven't found that temp in my v81b install.
              > >
              > >Thanks,
              > >
              > >-Dino
              > >
              > >
              >
              

  • JSP Can't compile

    Using OC4J 9.03
    Launching OC4J as standalone server, noone JSP can be compiled because a NoClassDefFoundError for the class
    sun/tools/javac/Main.
    I copied in the j2ee\home directory the tools.jar file, that include this class, but the problem persists.
    All the environmente variables (JAVA_HOME, J2EE_HOME, CLASSPATH and so on) are properly (I hope) setted.
    Has someone any suggestion?
    Thanks

    Is the "JAVA_HOME" variable pointing to a JDK distribution, or a JRE?

  • "No tag library could be found with this URI" error while compiling jsp

    I am using WebLogic Server 9.2 MP1, JDK 1.5.0_09, Struts 1.3.5
              I am pre-compiling jsp pages with wlappc ant task. However, I got following errors when a jsp page contains ant taglib:
              No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
              The jsp page looks like:
              <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
              wlappc complains taglib could not be retrieved from this uri. Actually, since Struts 1.3.5, those ".tld" files are contained in strust-taglib-1.3.5.jar, folder META-INF/tld/. And I don't need to set anything in web.xml <tag-lib> tab anymore.
              All the jsp pages can be successfully compiled while being deployed to Server. So what am I missing? My build.xml file looks like:
                   <target name="compile-jsp">
                        <wlappc source="${src.dir}" output="${out.dir}"
                             keepgenerated="true" optimize="true" classpathref="wl_classpath"/>
                   </target>
              where "wl_classpath" contains all the struts related jar files, e.g. struts-core-1.3.5.jar, struts-taglib-1.3.5.jar, ...., and weblogic related jars, e.g. weblogic.jar.....
              I checked "beehive" samples coming with weblogic92, and found it pretty much did the same thing regarding build script and jsp files. So I am totally lost!
              Please help me out. Many thanks.
              Edited by jqian at 02/02/2007 10:24 AM

    Yes sorry, you're correct. The uri I mentioned is just 1.0.
    Do you have the "Oracle WebLogic Web App Extension" Facet for your web project? If not, try adding that and making sure that there is a weblogic.xml file created in the WEB-INF dir. The weblogic.xml file allows you to deploy usig a shared lib for JSTL. It should contain a library-ref element something like the following, with a version of 1.1.
    <wls:library-ref>
    <wls:library-name>jstl</wls:library-name>
    <wls:specification-version>1.1</wls:specification-version>
    <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>

  • JDeveloper's compiled JSP location in a .war file

    When I choose to build a .war file in JDeveloper 10.1.2 that contains the .JSP files, it sticks the compiled jsps in WEB-INF/classes/.jsps. To get the app server to properly recognize the precompiled JSPs, they need to be located in the WEB-INF/classes directory.
    How can I configure JDeveloper to put the compiled JSPs in WEB-INF/classes?

    JSPs in a web application are neither in WEB-INF/classes or WEB-INF/classes/.jsps directory.
    JSPs are in the top level directory.
    Servlets are in the WEB-INF/classes directory.

  • Can't compile.

    Hi,
    I was a VB developer and started to develop using java recently.
    I had to do some modification in a existing java project uses tomcat as the web server. I'm using Jbuilder 9 toas my editor. what I'm doing is open files using jbuilder and do the modification. I did couple of changes in my jsp files and those changes are working fine. Recently I had to do a modification in one of .java file. So I opened the file using Jbuilder and did the modification. then when I tried to compile the file It gave a lot of errors. when i run the site without the change i did to .java file it's working perfectly.
    most of the error like.
    <file name>.package <path> doesnot exist at line <line number>, column<column number>
    but those files exist in relavant folders reffered and i think when i'm compiling the .java file it can't refer those files.
    How can I compile my .java file and make the .class file.
    Thanks in advance.

    hi arijit_datta,
    Here I list down couple of errors I got when trying to compile.
    "LeaveApplication.java": package com.HRM.eLeave.dbhandle does not exist at line 3, column 35
    "LeaveApplication.java": package com.HRM.eLeave.util does not exist at line 11, column 1
    "LeaveApplication.java": cannot resolve symbol: class Environment in class com.HRM.eLeave.leaveApplication.LeaveApplication at line 31, column 72
    "LeaveApplication.java": cannot resolve symbol: class Environment in class com.HRM.eLeave.leaveApplication.LeaveApplication at line 397, column 19

  • How to Compile Jsp File in Class File , Protect my JSP from outworld

    Hello Friends
    My name is chandra prakash, I'm new for u. I've develop a web based software completely in JSP, some files are also written in Java Script. This software have aprox. 40 files --> 30 in JSP + 2 in Java Script + 8 image files .
    Each JSP calls another. and run this on 58 clints machine simultaneusly. we used Oracle 9iAS as back end and Oracle9iAS web Server . Where we found less clients like 20-30 we use Tomcat 5.0 web server .Sir problem is this we don't wan't to leave our jsp source code on server.
    Is any method or third party tool by which we can convert our JSP source file in CLASS file as like real class files provide by javac.
    For this perpose we make a folder and put all files in it. Create a context on Tomcat for this folder.Create a data source for this in tomcat. Bcase this program uses Data source and connect many times to database & fetches many type of data from database. We use servlet files of tomcat for this context in WORK folder of Tomcat. and after that rename our Source file Folder. and again run our program through batch file i'm strange program runs 2-3 steps, after few times it start producing errors.
    Sir do u hava work on this field can u help me to protect this JSP source code.
    I've Use Jikes.com compiler but not get any succes, It may be i'm not using correctly .
    Pls sir give me any suggesition.
    Chandra prakash

    1. Highlight your web project or the individual file
    2. Right click
    3. Select Rebuild to build all jsp files or Make to rebuilt only changed files

Maybe you are looking for