?
Solved

Tomcat - Apache and JSP not finding class files

Posted on 2005-05-14
8
Medium Priority
?
430 Views
Last Modified: 2013-11-24
Hi.

I have a jsp/ java class application on tomcat / Apache.  My package is called diablopackage it is located in tomcathome/shared/classes/diablopackage . I have created a test page to see what the problem might be called indextest.jsp .


I had this working on hte live environment, but I need to create a local copy of the site for testing / redevelopment.  

I get errors like this:

An error occurred at line: 18 in the jsp file: /indextest.jsp
Generated servlet error:
/root/jakarta-tomcat-5.0.28/work/Catalina/diablolocal/_/org/apache/jsp/indextest_jsp.java:420: ';' expected
    out.print modPresentation.formatMoney(new Double(2.5));


modPresentation is a class in diablopackage which is in my classpath and is  imported intothe page using:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>


at the top.  Like I say this was working in hte live environment, but not on my machine. I think it is a configuration issue
0
Comment
Question by:rosshind
  • 5
  • 2
8 Comments
 

Author Comment

by:rosshind
ID: 14001757
The full stack trace reveals that the jsp is not compiled prolperly (I thinK)


2005-05-14 11:22:22 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 18 in the jsp file: /indextest.jsp
Generated servlet error:
/root/jakarta-tomcat-5.0.28/work/Catalina/diablolocal/_/org/apache/jsp/indextest_jsp.java:420: ';' expected
    out.print diablopackage.modPresentation.formatMoney(new Double(2.5));
                           ^
1 error



      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:534)
0
 
LVL 29

Accepted Solution

by:
bloodredsun earned 2000 total points
ID: 14001902
Looks like a simple syntax error in the JSP, as you said.

Can you post the code?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 14001915
Try deleting the compile jsp after checking it for errors
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rosshind
ID: 14002091
There isnt an error in code. The error message is eroneous. The code has been working fine on the live environment, there is not a prob with missing semi-colons.  I get the same or similar errors on every page of the application.  The problem is to do with configuration.  To eliminate the possibility of syntax errors I have created a test page which is very simple and looks like this:
<code>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.*, java.sql.*, diablopackage.*" %>


<body bgcolor="#FFFFFF"  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
hello
<%
    out.print diablopackage.modPresentation.formatMoney(new Double(2.5));
%>
</code>



A point to note,  it doesnt matter what I put into the <%@ page import="java.util.*, java.sql.*, diablopackage.*" %> line.  I still get the same error on this test page even if i put for example :<%@ page import="javaMadeup.util.*, javaShouldRaiseError.sql.*, diablopackageNotThere.*" %>


I guess nobody has come up with this problem before?
0
 

Author Comment

by:rosshind
ID: 14002106
Forget those <code> and </code> tags, I put that in because I thought experts-exchange would interpret them as HTML,  sorry.
0
 

Author Comment

by:rosshind
ID: 14002159
if I completely delete the page import tag I get the same error.  The problem is caused by those imports not working correctly, so the JSP does not have access to anything in diablopackage, or in the other imports...

Any ideas about how I can get the imports working?
0
 

Author Comment

by:rosshind
ID: 14002393
Sorry All.  I have been following tcompletely the wrong line of enquiry here.  You are correct .  Sincere apologies.
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 14002420
Great. Glad it was easy to sort out, and thanks for the points and grade :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question