This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Plop plop !! ^_^ I have : -> Apache 2.0.48, -> Jakarta Tomcat 4.1.27, -> java 1.4.1_06 -> window XP and I can't compile JSP pages (examples from Tomcat)!! :'-(( this is mi error 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 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:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190) 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:256) 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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) 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.StandardContext.invoke(StandardContext.java:2416) 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:171) 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.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:263) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:536) Can you help me ??? please !!! NB : examples with servlet work very well but examples with JSP don't !!! [ February 24, 2004: Message edited by: Antoine BLANC ]
Try running the example JSPs provided with Tomcat. If they compile well then the problem is with your source code.
Antoine BLANC
Greenhorn
Joined: Feb 24, 2004
Posts: 6
posted
0
Originally posted by Amigo Mine: Try running the example JSPs provided with Tomcat. If they compile well then the problem is with your source code.
I only try examples from TomCat !! and they still don't work !!!
Annekee Dufour
Ranch Hand
Joined: Nov 04, 2003
Posts: 41
posted
0
did you download the jdk or the jre? The jre does not have a compiler.
Antoine BLANC
Greenhorn
Joined: Feb 24, 2004
Posts: 6
posted
0
Originally posted by Annekee Dufour: did you download the jdk or the jre? The jre does not have a compiler.
i have downloaded the j2sdk1.4.1_06 ! but the thing I don't understand is that why servlet work and JSP not !!
Annekee Dufour
Ranch Hand
Joined: Nov 04, 2003
Posts: 41
posted
0
It is talking about line -1 and file null. Is it possible that tomcat cannot find the jsp file? Is the file there? Is it readable? And how about the 'work' directory. Tomcat first creates a servlet there (a .java file), and that's what he tries to compile. Did tomcat create a servlet in a work subdirectory?
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
Can you see the normal Tomcat startup page at all? That is actually index.jsp so if you see it you are getting at least one JSP to run. Bill
Servlets come pre-compiled, and so no compiler need be invoked. For the JSPs (in that version of Tomcat, no longer true for 5.x), the JSPs are not precompiled. So that's one way to start thinking about how servlets and jsps are different, and can exhibit different behaviour. The problem of "servlets work, but JSPs don't" is common.
I'm willing to bet you have a space in the path under which you've installed Tomcat. c:\Program Files\Apache Group\Apache Tomcat 4.1.27 perhaps ?
CATALINA_HOME doesn't like spaces at all, so try one of these: 1) re-install in a path with no spaces 2) modify your startup.bat script to enclose the path in " " quotes. [ February 25, 2004: Message edited by: Mike Curwen ]
roy joseph
Greenhorn
Joined: Dec 26, 2003
Posts: 25
posted
0
if you are using windows98 then spaces should be removed. i used w2000 and xp and spaces were no problem.
[/qoute] I'm willing to bet you have a space in the path under which you've installed Tomcat. c:\Program Files\Apache Group\Apache Tomcat 4.1.27 perhaps ?
CATALINA_HOME doesn't like spaces at all, so try one of these: 1) re-install in a path with no spaces 2) modify your startup.bat script to enclose the path in " " quotes. [ February 25, 2004: Message edited by: Mike Curwen ]
be annoying .. Aku Soku Zan
Geoffrey Falk
Ranch Hand
Joined: Aug 17, 2001
Posts: 171
posted
0
There is most likely an error in your JSP.
Try using Tomcat 5. The error reporting is a little better.
Originally posted by William Brogden: Can you see the normal Tomcat startup page at all? That is actually index.jsp so if you see it you are getting at least one JSP to run. Bill
The welcome page and the example JSPs in Tomcat come pre-compiled. So it's possible for them to run but not your own if there is a problem.
Have a look into /TomcatDirectory/Work/Standalone/ and look further for your class file. If it exists then Tomcat is comiling the file successfuly using the installed JDK. Also, check for the file permissions of your JSP page within winXP (by right-clicking -> properties) if its read-only.
Rahul Singh Khokhar
Ranch Hand
Joined: Feb 23, 2005
Posts: 36
posted
0
Also further, as Mike & Roy pointed out: U need to remove spaces with WinNT & Win98 for your tomcat installation. Windows XP has no problems with it though.