Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error, package does not exist, thrown when calling jsp page

843836Sep 22 2004 — edited Sep 23 2004
Hi

I have downloaded sample jsp pages for interaction with Crystal reports. When I compile these jsp pages in NetBeans 3.6 there are no problems. When I deploy these pages and associated libraries to Tomcat 5, I get the following error when attempting to call the jsp page, but all the jars used in NetBeans are present in the web-inf/lib directory and I have looked in the jars and found classes in the com.crystaldecisions.report.web.viewer package. I have been unable to find any information after googling and looking at the jakarta bug database. What am I doing wrong?

The error...

2004-09-22 17:40:30 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp

Generated servlet error:
[javac] Compiling 1 source file

E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:9: package com.crystaldecisions.report.web.viewer does not exist
import com.crystaldecisions.report.web.viewer.*;
^
E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:180: cannot resolve symbol
symbol : class CrystalReportInteractiveViewer
location: class org.apache.jsp.SimplePreviewReport_jsp
CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
^



An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp

Generated servlet error:
E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java:180: cannot resolve symbol
symbol : class CrystalReportInteractiveViewer
location: class org.apache.jsp.SimplePreviewReport_jsp
CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
^



An error occurred at line: 1 in the jsp file: /CrystalReportsInteractiveViewer.jsp

Generated servlet error:
Note: E:\Tomcat5\work\Catalina\localhost\crystal\org\apache\jsp\SimplePreviewReport_jsp.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
3 errors


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)

The offending page is ....
<%
/*==========================================================================
INSTANTIATE THE VIEWER AND DISPLAY THE REPORT THROUGH THE INTERACTIVE VIEWER
============================================================================
    - Create a Viewer object
    - Set the source for the  viewer to the client documents report source
    - Process the http request to view the report
    - Dispose of the viewer object
*/

// Create an Interactive Viewer
CrystalReportInteractiveViewer viewer = new CrystalReportInteractiveViewer();
// Set the name for the interactive viewer
viewer.setName("Crystal_Report_Interactive_Viewer");
// Set the source for the interacive viewer to the client documents report source
viewer.setReportSource(clientDoc.getReportSource());
// Process the http request to view the report
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
// Dispose of the viewer object
viewer.dispose();
%>
included in...
<%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.lib.*"%>
<%@ page import="com.crystaldecisions.report.web.viewer.*"%>

<html>
<head>
<title>Begin Here - Simple Preview Report</title>
</head>
<body>

<%
/*=================================================================
 WORKING WITH THE REPORT APPLICATION SERVER AND JSP TO VIEW REPORTS
===================================================================

Authors Name: Ken Andony
Technology supported by the app: Report Application Server

  ALWAYS REQUIRED STEPS
   - Create a new Report Application Session
   - Create a Report Application Server (RAS) Service
   - Set the RAS Server to be used for the service
   - Initialize the RAS Service
   - Create the report client document object
   - Set the RAS Server to be used for the report client document
   - Open the report, and set the open type to Read Only

  INSTANTIATE THE REPORT VIEWER
   - Create a Viewer object
   - Set the source for the viewer to the client documents report source
   - Process the http request to view the report
   - Dispose of the viewer object
==================================================================*/

/**
 * This line creates a string variable called reportname that we will use to pass
 * the Crystal Report filename (.rpt file) to the OpenReport method contained in
 * the AlwaysRequiredSteps.jsp.
*/
String reportName ="SimplePreviewReport.rpt";
%>

<%
/* ALWAYS REQUIRED STEPS

  Include the file AlwaysRequiredSteps.jsp which contains the code
  for steps:
   - Create a new Report Application Session
   - Create a Report Application Server (RAS) Service
   - Set the RAS Server to be used for the service
   - Initialize the RAS Service
   - Create the report client document object
   - Set the RAS Server to be used for the report client document
   - Open the report, and set the open type to Read Only */
%>
<%@ include file="AlwaysRequiredSteps.jsp"%>

<%
/* INSTANTIATE THE REPORT VIEWER

  There are three Report Viewers:

  1.  Crystal Reports Interactive Viewer
  2.  Crystal Reports Viewer
  3.  Crystal Reports Parts Viewer

  The choices are CrystalReportsInteractiveViewer.jsp, CrystalReportsViewer.jsp,
  CrystalReportsPartsViewer.jsp
  Note that to use this include you must have the appropriate .jsp file in the
  same virtual directory as the main jsp page.

  =============================================================================
    DISPLAY THE REPORT
    - display the report using one of the Thin Client DHTML viewers

   Include one of the DHTML Viewers.
    - Crystal Reports Interactive Viewer		=   CrystalReportsInteractiveViewer.jsp
    - Crystal Reports Viewer								=   CrystalReportsViewer.jsp

    - Crystal Reports Parts Viewer					=   CrystalReportsPartsViewer.jsp

    Note** - To use the report parts viewer successfully you are required to
    choose and name three objects in the report to Node0, Node1 and Node2.
    You can access an objects name by using the Format Editor dialog box.
    For more information on the Format Editor Dialog Box and setting objects
    names, please refer to the Help Contents (Help Menu->Crystal Reports Help)
    or by pressing F1
  =============================================================================*/
%>
<%@ include file="CrystalReportsInteractiveViewer.jsp" %>

</body>
</html>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2004
Added on Sep 22 2004
4 comments
1,317 views