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

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>

Thanks Tien-Chih Wang. It worked...well I'm getting a new set of errors, but progress has been made!
I understand that if placed in the common directory the jar will be available to all webapps but why does it make a difference whether a jar file is placed under the $TOMAT_HOME/common/lib or $TOMAT_HOME/webapps/appname/web-inf/lib directory if I only need to access the jar from one webapp?

Similar Messages

  • Import javax.servlet.* gives error "package does not exist"

    I am working through Monica Pawlan's book "Essentials of Java PL".
    My PC runs Windows2000 prof. I have downloaded and installed j2sdk-1_3_1_01-win.exe in c:\jdk1.3.1_01
    I have downloaded and installed tomcat4.0 (jakarta-tomcat-4.0.zip) into c:\jakarta-tomcat-4.0
    CATALINA_HOME is set to c:\jakarta-tomcat-4.0 and CLASSPATH is set to .;C:\jakarta-tomcat-4.0\common\lib\servlet.jar
    I can compile an applet starting:
    import java.awt.Color;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    import javax.swing.*;
    //Class Declaration
    class SwingUI extends JFrame implements ActionListener { ... }
    but trying to compile my servlet starting:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ExampServlet extends HttpServlet { ... }
    gives me the error (import javax.servlet.*) "package does not exist".
    Any pointers on this immediate problem? and is my book out of date?
    Many thanks,
    James Towell

    You downloaded the Java 2 SDK Standard Edition, but you need to also download the Enterprise Edition if you want to write programs that use enterprise features.

  • List View webpart from subsite to Top site shows random error "List Does not exist"

    Hi All,
    We have a list in subsite and we are creating a view for that list which we are showing in one of the top site home page. We have taken care of changing the web and list guid of list view webpart when we added on top site. Its working fine but some time
    shows error "list does not exist" but when we refresh the error goes. Is it known issue or if there is any workaround for this? because we cannot go live with this random error.
    Rohit Pasrija

    try these links:
    http://mroffice365.com/2012/01/sharepoint-display-a-list-or-library-from-subsite-to-the-top-level-site/
    http://sharepoint.stackexchange.com/questions/37140/display-list-or-library-on-another-site-as-webpart

  • Error:  microedition.io.* package does not exists

    Been at this for a few days...frustration...funny.
    Using JDK 1.6 NetBeant 6.8 with WTK 2.5.2 on XP
    Was able to resolve the javax.bluetooth.* package does not exists and xylostudio by doing the following to add the libraries to the project file.
    1) Tools > Libraries
    2) in the pop up Library Manager window click 'New Library'
    3) in the pop up New Library window typed 'bluetooth' > OK
    3) highlight 'bluetooth' in Library Manager scroll menu on left
    4) click add JAR/Folder
    5) added jsr082 from C;\WTK2.5.2_01\lib\jsr082.jar
    6) click OK
    7) right click project and select properites
    8) highlight the library node under Categories on the left side of the Project Properties window
    9) 'Add Library' created 'bluetooth'
    10) click OK
    When the process was followed to resolve the microedition.io.* package does not exist error it was unsuccessful.
    The difference in the two processes being New Library name: 'microedition' and added jsr75, MIDPapi20, jsr118, then MIDPapi21 with no resolution to the errors.
    Also add the jsr75, MIDPapi20, jsr118, and MIDPapi21 directly to the project by clicking the 'Add JAR/Folder' button in the Project Properties window.
    Here is the Output:
    init:
    deps-clean:
    Updating property file: C:\Scholastic\4340MS\REU\ItsAForum\build\built-clean.properties
    Deleting directory C:\Scholastic\4340MS\REU\ItsAForum\build
    clean:
    init:
    deps-jar:
    Created dir: C:\Scholastic\4340MS\REU\ItsAForum\build
    Updating property file: C:\Scholastic\4340MS\REU\ItsAForum\build\built-jar.properties
    Created dir: C:\Scholastic\4340MS\REU\ItsAForum\build\classes
    Created dir: C:\Scholastic\4340MS\REU\ItsAForum\build\empty
    Compiling 8 source files to C:\Scholastic\4340MS\REU\ItsAForum\build\classes
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:8: cannot find symbol
    symbol : class Connector
    location: package javax.microedition.io
    import javax.microedition.io.Connector;
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:9: cannot find symbol
    symbol : class StreamConnection
    location: package javax.microedition.io
    import javax.microedition.io.StreamConnection;
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:10: cannot find symbol
    symbol : class StreamConnectionNotifier
    location: package javax.microedition.io
    import javax.microedition.io.StreamConnectionNotifier;
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:19: cannot find symbol
    symbol : class StreamConnectionNotifier
    location: class mobile.communication.Server
    private StreamConnectionNotifier server = null;
    ^
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:20: cannot find symbol
    symbol : class StreamConnection
    location: class mobile.communication.Server
    private StreamConnection connection = null;
    ^
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:58: cannot find symbol
    symbol : class StreamConnectionNotifier
    location: class mobile.communication.Server
    server = (StreamConnectionNotifier)Connector.open(URL);
    ^
    C:\Scholastic\4340MS\REU\ItsAForum\src\mobile\communication\Server.java:58: cannot find symbol
    symbol : variable Connector
    location: class mobile.communication.Server
    server = (StreamConnectionNotifier)Connector.open(URL);
    ^
    7 errors
    C:\Scholastic\4340MS\REU\ItsAForum\nbproject\build-impl.xml:413: The following error occurred while executing this line:
    C:\Scholastic\4340MS\REU\ItsAForum\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 4 seconds)
    any information would be much appreciated. Thanks,
    LD

    By completing the process shown in below link and adding the bluecove jar file directly to the project as of the reply post suggests, all compilation errors were corrected.
    http://forums.netbeans.org/viewtopic.php?t=22823&start=0&postdays=0&postorder=asc&highlight=microedition
    Thanks me for point me in the right direction,
    Me is happy.

  • Package does not exist error-message

    When I try to compile a java servlet with the following piece of code I get a compilation error referring to the import statement.
    I have just included the initial import statements. A large number of errors follow, as a result of this 'package does not exist error-message'.
    Has anyone encountered this or any ideas?
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.* ;
    import java.io.* ;
    import java.sql.* ;
    import com.ericsson.snf.mps.mppapi.mtlr.*;
    The error messages come from the 'import com.ericsson.snf.........' statement.
    I am trying to integrate ericsson software, into my application.
    Thanks,
    java-mobile-user

    That's probably because you are trying to integrate j2me suff with j2se/ee. That won't work without los of extra work..

  • Package does not exist when compile in Jgrasp 1.8.3

    I have a package called jpb stored in a folder called jpb. The package has two files SimpleIO.java and Convert.java. My program has 1 of the line like this
    import jpb.*;
    I put the path and classpath in Jgraps pointing to the folder jpb but when I compile the program, it keeps saying the package does not exist. Even when i took all the files outside and place it in the same folder with the file that i am compiling. It says that bad class file. The heck?????????.
    Can some1 please help. I even made an autoexec.bat to set up the path to the folder and run it. it keeps saying the package does not exist.

    Classpaths reference things like jar files or directories that contain .class files. Change your classpath to have the .jar files.

  • Windows 8 Remote Desktop Error "The Requested Security Package Does Not Exist"

    When my remote host (win server 2008 R2) is configured to use SSL for security layer, RDP from my Windows 8 gets  
    "An authentication error has occurred. The requested security package does not exit."
    When the host is set to use RDP security layer, it works fine. 
    Registry key solution for Win7 suggested on other posts does not seem to apply to win8.
    This is a Lenovo desktop, I uninstalled silverlight and bunch of other OEM installed programs.

    This fixed my problem in Windows 8 while connecting to a Windows 7 host.  I needed the pku2u entry.  I decided to look it up and here's the info for anyone that's interested.
    Introducing PKU2U in Windows
    Applies To: Windows 7, Windows Server 2008 R2
    This product evaluation topic for the IT professional describes the Public Key Cryptography Based User-to-User (PKU2U) security support provider (SSP) that is new in Windows 7 and Windows Server 2008 R2.
    PKU2U protocol
    The PKU2U protocol in Windows 7 and Windows Server 2008 R2 is implemented as an SSP. The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing
    between computers that are not members of a domain.
    How PKU2U works
    Windows 7 and Windows Server 2008 R2 introduce an extension to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decides whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate,
    Negoexts, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. You can also develop or add other SSPs.
    When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When
    validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes.
    For more information about developing SSPs, see
    Custom Security Packages in the MSDN Library.
    For more information about the Negotiate extensions (Negoexts), see
    Introducing Extensions to the Negotiate Authentication Package.

  • Import statement reports 'package does not exist'

    I am seeing another odd error. I'm working on learning how to read and write to text files, and I have 2 errors reported, but one is obviously caused by the other. My package is labeled as such (copy>paste of package line):
    package michaelchristopherp4db;
    and the import line is this (copy>paste again):
    import michaelchristopherp4db.ProductRecord;
    However, Netbeans looks at the import and flags it red, saying package michaelchristopherp4db does not exist. this caused my line:
    ProductRecord product = new ProductRecord();
    to also be flagged in red as it cannot find the ProductRecord class. However, it has no problems with any of the product.get* method calls. Thank you in advance for any ideas or input.
    here is the full code of the file reporting the errors.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.lang.SecurityException;
    import java.util.NoSuchElementException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.Scanner;
    import michaelchristopherp4db.ProductRecord;
    /*  @author info
    public class readTxt
        private Scanner txtfile;
        private Formatter wishList;
        private Formatter giftIdeas;
        private Formatter priceError;
        //let user open file
        public void openFile()
        {//open method openFile
            try
            {//open try block
                priceError = new Formatter("priceerror.txt");//open object for items with invalid prices
                giftIdeas = new Formatter("giftideas.txt");//open object for gift ideas
                wishList = new Formatter("wishlist.txt");//open object for wish list
                txtfile = new Scanner(new File("products.txt"));//tell the compiler which file to use for input
            }//close try block
            catch (FileNotFoundException fileNotFoundException)
            {//open file not found catch block
                System.err.println("Error opening or creating file.");
                System.exit(1);
            }//close file not found catch block
            catch ( SecurityException securityException )
            {//start catch for SecurityException
                System.err.println("File Write access is denied.");
                System.exit(1);//END PROGRAM
            }//end catch
        }//close openFile method
        public void readProducts()
        {//open readProducts method
            ProductRecord product = new ProductRecord();//create object to hold read data
            //print headers for for output columns
            System.out.printf("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            try //read records from the file
            {//open try block
                while (txtfile.hasNext())
                {//open while
                    product.setproductID(txtfile.nextInt());//get productID
                    product.setproductName(txtfile.next());//get product name
                    product.setproductPrice(txtfile.nextDouble());//get product price
                    //print collected product details
                    System.out.printf("%-10d%-12s%10.2f\n", product.getproductID(),
                            product.getproductName(), product.getproductPrice());
                    if (product.getproductPrice()>50.0)
                    {//open if to store items $50 or more to wishlist.txt
                        wishList.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if $50 or greater
                    else if (product.getproductPrice()<0.0)
                    {//open if less than zero
                        priceError.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if less than zero
                    else
                    {//open else for gift ideas from $0 to $50
                        giftIdeas.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close else for gift ideas
                }//close while
            }//close try block
            catch (NoSuchElementException elementException)
            {//open no such element exception catch
                System.err.println("File improperly formed.");
                txtfile.close();//close text file
                System.exit(1);
            }//close no such element exception catch
            catch (IllegalStateException stateException)
            {//open illegal state exception catch
                System.err.println("Error reading from file.");
                System.exit(1);
            }//close illegal state exception catch
        }//close readProducts method
        //close file and end application
        public void closeFile()
        {//open closeFile method
            if (txtfile != null)
                txtfile.close();//close file
        }//close closeFile method
    }//end application readTxtAnd the code at the top of the class I am trying to import (so you can see the package I am trying to import)
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db;
    *  @author
    public class ProductRecord {

    I am embarrassed to admit this, but I am completely lost on the last question.. I have no clue wether it is a convenience for development or a dependancy, as I have not learned those terms or distinctions yet. For now I copied the ProductRecord file into my new project folder and renamed it's project line to match the new project name. However, while that eliminated the package does not exist error, and netbeans reports no errors now, when I run the program it does not write the new files. I have made some modifications to the code tryiing to get it to write properly but so far no luck in makingit work. Here is the current version of the file not running right.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package michaelchristopherp4db2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.lang.SecurityException;
    import java.util.NoSuchElementException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.Scanner;
    /*  @author
    *   Michael Christopher
    *   IT215-1004D-03
    *   December 30, 2010
    *   Phase 4 DB 2
    public class readTxt
        private Scanner txtfile;
        private Formatter wishList;
        private Formatter giftIdeas;
        private Formatter priceError;
        //let user open file
        public void openFile()
        {//open method openFile
            try
            {//open try block
                priceError = new Formatter("priceerror.txt");//open object for items with invalid prices
                giftIdeas = new Formatter("giftideas.txt");//open object for gift ideas
                wishList = new Formatter("wishlist.txt");//open object for wish list
                txtfile = new Scanner(new File("products.txt"));//tell the compiler which file to use for input
            }//close try block
            catch (FileNotFoundException fileNotFoundException)
            {//open file not found catch block
                System.err.println("Error opening or creating file.");
                System.exit(1);
            }//close file not found catch block
            catch ( SecurityException securityException )
            {//start catch for SecurityException
                System.err.println("File Write access is denied.");
                System.exit(1);//END PROGRAM
            }//end catch
        }//close openFile method
        public void readProducts()
        {//open readProducts method
            ProductRecord product = new ProductRecord();//create object to hold read data
            //print headers for for output columns
            wishList.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            giftIdeas.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            priceError.format("%-10s%-12s%10s\n", "Product ID", "Product Name", "Price");
            try //read records from the file
            {//open try block
                while (txtfile.hasNext())
                {//open while
                    product.setproductID(txtfile.nextInt());//get productID
                    product.setproductName(txtfile.next());//get product name
                    product.setproductPrice(txtfile.nextDouble());//get product price
                    if (product.getproductPrice()>50.0)
                    {//open if to store items $50 or more to wishlist.txt
                        wishList.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if $50 or greater
                    else if (product.getproductPrice()<0.0)
                    {//open if less than zero
                        priceError.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close if less than zero
                    else
                    {//open else for gift ideas from $0 to $50
                        giftIdeas.format("%-10d%-12s%10.2f\n", product.getproductID(),
                                product.getproductName(), product.getproductPrice());
                    }//close else for gift ideas
                }//close while
            }//close try block
            catch (NoSuchElementException elementException)
            {//open no such element exception catch
                System.err.println("File improperly formed.");
                txtfile.close();//close text file
                System.exit(1);
            }//close no such element exception catch
            catch (IllegalStateException stateException)
            {//open illegal state exception catch
                System.err.println("Error reading from file.");
                System.exit(1);
            }//close illegal state exception catch
        }//close readProducts method
        //close file and end application
        public void closeFile()
        {//open closeFile method
            if (txtfile != null)
                txtfile.close();//close file
        }//close closeFile method
    }//end application readTxtwith the System.out.printf lines in the ReadProducts method it would properly print to screen all of the elements in the products.txt file, it is not outputting to the other .txt files at all. I will be exploring the closeFile method in case the error is due to not closing all of the files in that method, but does anyone else see what might cause it not to output the data to the appropriate .txt files?

  • FTPClient Package does not exist?

    I have an FTP program. I'm trying to use this package. Here is a link to the class package overview:
    http://www.enterprisedt.com/downloads/ftp/doc/com/enterprisedt/net/ftp/FTPClient.html
    When I attempt to compile, I get the error that the package does not exist. I am importing these packages:
    import java.lang.Object.*;
    import java.lang.*;
    // This package causes the error
    import com.enterprisedt.net.ftp.FTPClient.*;
    Is there something I need to download, or some other package to import?
    Thanks,
    Logan

    Hi,
    I finally found the ftp.jar and downloaded it and put it in the /j2se/jre/lib/ext.
    I can now compile with this import line:
    import com.enterprisedt.net.ftp.*;
    Now my problem is trying to get this to work:
    String server = "192.168.1.100";
    String user = "logan";
    String passwd = "passwd";
    try {
    FTPClient ftp = new FTPClient(server);
    } catch (IOException ex) {
    System.out.println("Caught exception: "+ex.getMessage());
    But I get this error when compiling:
    unreported exception blah blah must be caught or declared to be thrown
    Thanks.
    - Logan

  • Compiler exception - package does not exist?

    I am new to NWDS and J2EE.  I followed the steps in the tutorial as indicated in the below link:
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/netweaver-application-server/_netweaver-application-server/a-c/Creating%20your%20First%20J2EE%20Application.pdf
    I did everything inside up to the last moment after I deployed my EAR and tried to run from the portal but got Application error.  I checked the defaultTrace log file from the portal server and notice these errors:
    #1.5 #001A6431E0FE0020000000750000155C0004B9B284863A19#1330076285575#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#sap.com/CalculatorEar#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#Guest#0##40C36AF65ECB11E18721000000978DDA#40c36af65ecb11e18721000000978dda-0#40c36af65ecb11e18721000000978dda#SAPEngine_Application_Thread[impl:3]_21##0#0#Error#1#/System/Server/WebRequests#Plain###application [Calculator] Processing HTTP request to servlet [jsp] finished with error.
    The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process: [G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:41: package com.sap.examples.calculator.beans does not exist
              com.sap.examples.calculator.beans.CalcProxy calc = null;
                                                     ^
    G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:42: package com.sap.examples.calculator.beans does not exist
                   calc = (com.sap.examples.calculator.beans.CalcProxy)pageContext.getAttribute("calc", PageContext.SESSION_SCOPE);
                                                                     ^
    G:/usr/sap/EPD/JC00/j2ee/cluster/server0/apps/sap.com/CalculatorEar/servlet_jsp/Calculator/work/jsp_Calculator1330076284538.java:48: package com.sap.examples.calculator.beans does not exist
                        calc = (com.sap.examples.calculator.beans.CalcProxy) Beans.instantiate(getClass().getClassLoader(), "com.sap.examples.calculator.beans.CalcProxy");
                                                                             ^
    3 errors
    The thing I don't understand is the "comp.sap.examples.calculator.beans" class has already been included inside the EAR (I used my zip tool to check the EAR file and confirmed it's there), why did the compiler still complain that the package does not exist?  Any great guys & gals out there can help this poor newbie who spent the past 5 hours searching for Google for answers but couldn't find any??
    Thank you.
    Brian

    Perhaps I should give out more information about this problem.
    The EAR file contains a WAR file and a JAR file. 
    The WAR file contains a JSP and it contains codes to refer to a java proxy class of package comp.sap.examples.calculator.beans.CalcProxy.
    So it seems the compilation error is triggered when it tries to compile the WAR file.
    I checked the structure of the WAR file using a zip tool.
    At the base it contains this:
    WEB-INF (a folder)
    Calculator.jsp (the JSP file)
    Inside the WEB-INF folder is these:
    classes (a folder)
    web-j2ee-engine.xml
    web.xml
    Inside the classes folder is a tree of subfolders to describe the structure of the CalcProxy class:
    classes -> comp -> sap -> examples -> calculator -> beans -> CalcProxy.class
    So the java class file and the JSP file is in the same bundle of the WAR file.
    Why the compiler is not able to find the class file inside the JSP?

  • Weird.. package does not exist

    I know this is a common question and i searched the forum but nothing there is what I need.
    First of all I have the 'main' source file under a directory: d:\Model1_SecurityService\
    There is a subdirectory securityservice, under which there are several other directories according to the packages I have.
    Another directory I have is: d:\Model1_Classes
    When I compile the main program from d:\Model1_SecurityService> typing the following: javac -d d:\Model1_Classes testmain.java
    When I do this, i get an error message saying package does not exist for each package I import in the main file.
    My classpath has d:\Model1_Classes in it and my path has .; etc.
    Anyone know what the problem is?
    Everything used to work but i continued working on another computer and after copying these changes to this one, i'm getting these errors...

    So, for example if you had a class Baz in package
    com.foo.bar and you're using d:\Model1_Classes as your
    root directory for your compiled code, then there
    should be a directory structure
    d:\Model1_Classes\com\foo\bar
    which contains the compiled class Baz.class. Is this
    what you have?yes
    I found the problem though, apperently i need . in my classpath as well; don't know why actually, but it works now.
    thanks for wanting to help though

  • Package does not exist problem

    Hello everyone:
    I am a very new programmer student, and I'm having a problem I cannot seem to resolve. I am setting up a method for a JButton, and with the first inputs I'm getting a package does not exist error. Here is the code in question:
    private void placeOrderJButtonActionPerformed( ActionEvent event )
              double subtotal = 0.00;
              // calculate subtotal
              if ( hamburgerJRadioButton.isSelected() )
                   subtotal += 6.95;
              else if ( pizzaJRadioButton.isSelected() )
                   subtotal += 5.95;
              else
                   subtotal += 4.95;
              // declare display format
              DecimalFormat dollars = new DecimalFormat( "$0.00" );
              // display subtotal
              subtotalJTextField.setText( dollars.format( subtotal ) );
    It is coming back with these errors:
    C:\Users\Brian\Desktop\LunchOrderForm.java:255: <identifier> expected
              subtotalJTextField.setText( dollars.format( subtotal ) );
    ^
    C:\Users\Brian\Desktop\LunchOrderForm.java:255: package subtotalJTextField does not exist
              subtotalJTextField.setText( dollars.format( subtotal ) );
    I declared subtotalJTextField as an instance variable, but I'm not sure what its telling me here. Could anyone help?

    When you post code, click on the "code" label and paste the code between the code tags.
    rnashting wrote:
              // display subtotal
              subtotalJTextField.setText( dollars.format( subtotal ) );
    It is coming back with these errors:
    C:\Users\Brian\Desktop\LunchOrderForm.java:255: <identifier> expected
              subtotalJTextField.setText( dollars.format( subtotal ) );
    ^It appears that the line with the error is not inside a method. Java does not allow you to write code like this outside a method (or an initializer block).
    C:\Users\Brian\Desktop\LunchOrderForm.java:255: package subtotalJTextField does not exist
              subtotalJTextField.setText( dollars.format( subtotal ) );
    I declared subtotalJTextField as an instance variable, but I'm not sure what its telling me here. Could anyone help?I can't tell from the code you posted where this problem is. You most likely have not declared subtotJTextField correctly.

  • Java.math package does not exist!!!

    hi java experts, i really desperately need some help. ihave been trying to compile a java program i have written that imports the java.math package as i am using the BigInteger class. I am using SUN ONE STUDIO ME 4 and have j2se SDk installed. when i try to build the program in the IDE, it gives me an error message saying the java.math package does not exist. i can't understand why. i think it's an IDE problem. i tried mounting the filesystem and i mounted almost a million times in diff ways but it still can't compile. i can't find the directory of the java.math to mount into. anyway i tried to compile it at the command prompt and it can compile but with errors... so i figure that i do have the java.math class on my system just that the IDE jsut can't recognise it. i am at my wits end and gonna go mad if someone doesn't please help me.
    adeline from singapore

    Cross-posted at http://forum.java.sun.com/thread.jsp?thread=293132&forum=54&message=1155073

  • Import javax.mail package does not exists

    Hi,
    when i tried to compile the source code for email using jdk1.3.1, it compiled fine. but when i tried to compile using jdk1.4.., it had the following errors such as
    import javax.mail package does not exists,
    import javax.mail.internet package does not exists
    package javax.activation does not exist
    Is it because of the jdk version problem???
    Pls help me

    I have the same problem with javax.ejb
    Now i've downloaded and installed the j2ee and set my classpath to the j2ee.jar. I've had to make a new path cause i'm running XP.
    This doesn't work.
    to compile it in Jcreator or JBuilder I can make it work by adding this package (j2ee.jar) in the project settings - required libraries.
    But I have to do this for every project again and again.
    I can make it work but i thougt the classpath would be enough ??
    Bassegio

  • Dunning error (form does not exist)

    Hi,
    While performing the dunning after selection the Individual dunning notice for printout the system shwoing error that '''FORM F150_DUNN_01''' DOES NOT EXISTS.
    When I tried several times to performance the dunning it showing the same error message as above said.
    Can any one let me know why does this happening. please give your valuable solution regarging on the above said issue.
    Thanks in Advance.
    Regards,
    Suresh

    Hi
    In Dunning Procedure --- FBMP
    you will select new entries and give Dunning procedure , name , dunning intervals in days , No. of dunning levels , line item grace periods , interest indicator , select standard transaction dunning checkbox , reference dunning procedure for texts(dunning procedure) and save.
    select Dunning texts button and give company code and select customer radio button and enter.
    select new company code button and give company code and enter.
    select seperate notice per dunning level checkbox
    Deselect Dunning by Dunning Area checkbox and save.
    select back arrow and select yes for the message to save the data.
    select dunning texts button once again , give company code , select customer and enter.
    Dunning level (1)  Form (F150_DUNN_01)
    Dunning level (2)  Form (F150_DUNN_01)
    Dunning level (3)  Form (F150_DUNN_02)
    Dunning level (4)  Form (F150_DUNN_02)
    select dunning levels button and under print parameters , select Always Dun CheckBox's.
    select charges button , give currency and enter.
    select back arrow and save
    Assign the Dunning procedure in Customer Master.
    Check with the Dunning Procedure you had created.
    Regards
    Venkat

Maybe you are looking for

  • Problem in creating Rule Class

    I am trying to build a Rules Application..I am totally a novice in this..Following the examples given in documentation i am trying to do it.. These are the steps i have donr till now.. CREATE or REPLACE TYPE Account_History AS OBJECT ( Account_Id VAR

  • [All Platforms][Search] Search songs or artists by the language or the country

    Hi, It would be great to be able to search/discover new stuffs by the language and country in the search engine .Like bands from Sweden, songs sung in Spanish / French ... It's not because we don't speak the language or understand the lyrics we can't

  • Getting purchased music and video from itunes

    I deleted some music and videos that i purchased from itunes store by accident from my computer. Is there a way that i can retrieve it from the store again without paying for it? I was able to view everything that I purchased but I couldn't find a wa

  • Apple TV slow slower slowest

    When I first unpacked my Apple TV everything was fine but now a year or so later I can't stream from iTunes, or the iTunes store. When I try to sync my Apple TV I have to leave my computer on for days and it still never finishes the sync. I have trie

  • Anyone know how iPhoto '08 handles RAW files?

    I use Aperture right now...just wondering