Importing package problem

Hi,
I am having some trouble understanding packages. The following simple code to sort an integer array generates an error ("cannot find symbol")...
import java.util.*;
public class TestArraySort
     public static void main(String[] args)
          int[] x = {5,8,2,7,4,1,6,3,9,10};          
          Arrays.sort(x);
}However if I change the import statement to
          import java.util.Arrays;The program compiles fine?
Why does the util.* statement not import all classes from the package??
Any help is greatly appreciated!
Thanks,
Alan K.

You must have a class called Arrays in the same
package as your class (the null package).Otherwise
importing * would work.But is that not what the import java.util.* does??Not exactly.
* simply means that java.util is one place where it can search if it runs across a class that it doesn't know about (because that class is not in the current package and has not been explicilty imported by name). Since you already have an Arrays class, it doesn't need to search in java.util.
>
To put my question another way, why can't I use the
"Arrays.sort(x)" class with this import statement...
import java.util.*;
You can if there's not already an Arrays that has been explicitly imported or is in the curren package.
Surely the * imports all of the classes?Nope. Just flags that package as a place to look.

Similar Messages

  • Import package problems

    hi:
    if my program need to import package A which store in :
    C:\Documents and Settings\sharon\My Documents\project
    and my java file also store in the same folder, but i always got this error:
    C:\Documents and Settings\sharon\My Documents\project\test.java:36: package A does not exist
    import A;
    can anyone please tell me what happen? i m a newbie to java, pls help.

    Assuming you have the following: C:\project\A\Class1.class
    C:\project\A\Class5.class
    C:\project\test.javaand assuming all the Class1.java-Class5.java files start with package A; and assuming test.java starts with import A.Class1; And assuming javac.exe is in a directory that's on your path (NOT classpath), then if you do, in a DOS promptjavac -classpath . test.java
    or
    javac -classpath C:\project test.java it will work.
    You say you're using an IDE. Somewhere in that IDE's preferences/options will be a place to set the classpath. It must include . (a dot, meaning the current directory) OR the full path up to and including ...\project. (Dot may actually not work, since the IDE might not have the same notion of "current directory" as you would in a DOS prompt. There may also be a setting for "project root" or something. It really depends on the IDE.)
    Side note: Convention in Java is for package names to be all lowercase, and for class names to start with uppercase.

  • Import package problem

    hi,
    I am trying to import some classes into my java file.The path is as follows:
    "c:\tinyos\tinyos-1.x\tools\java\net\tinyos\mcenter\treetable".I am importing the classes in the treetable package.
    when I write import tinyos.tinyos-1.x.tools.java.net.tinyos.mcenter.treetable,a problem occur because of the folder tinyos-1.x. do you have any idea about this situation? :(
    thanks in advance

    You are right, I cannot use "-" character in a Java identifier. In fact, you exactly point to the problem. The package I want to import is actually net.tinyos.mcenter.treetable. However, I have two similar "net" directories. their exact paths are as follows:
    1. c:/tinyos/cygwin/home/tinyos/tinyos-1.x/tools/java/net
    2. c:/tinyos/cygwin/opt/tinyos-1.x/tools/java/net
    I need to import the classes in the first "net" directory. However, it tries to find the classes in the second path and gives errors. therefore, I need to specify them exactly or somehow distinct them.
    Could you help me?
    thanks..

  • IMPORTING PACKAGE PROBLEMS

    Hi,
    I'm having problems with importing the following:
    import javax.swing.*;
    import javax.crypto.*
    I am currently using JDK1.3.1_01. I've looked in the main java folder there is no 'javax' folder, hence thats why the error message appears:
    package javax.swing.* does not exist
    What am i doing wrong? Is it contained in a Zip or Jar file or something, if so where? Do I need to make some Classpath setting?
    Please help giving me clear instructions as im no expert.
    thanx
    RIA

    Yes...I named the objects with capital letters e.g.
    JComboBox SexComboBox = new JComboBox();well, it would be a bit more readable to start object names with a lowercase letter
    (you might want to read about naming conventions one day: http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html)
    I added some comments to your code:
    SexComboBox.addActionListener(new
    java.awt.event.ActionListener() {
       /* This IS illegal syntax. The previous line starts a class definition.
           You should see at least one method declaration here:
            public void actionPerformed(ActionEvent e) {
            } // actionPerformed
          } // ActionListener
          I guess some lines have dropped out from your code here, because the
          following lines do not look like ActionListener code.
          You could try using the codelines above to fix your code
       SexComboBox.setEnabled(true);
       //Setup the sexComboBox item
       SexComboBox.addItem("Male");
       SexComboBox.addItem("Female");
       YearLabel.setText("Year");
       //setup the YearComboBox Item
       YearComboBox.addItem("1900");
       YearComboBox.addItem("1901");
       YearComboBox.addItem("1902");
       YearComboBox.addItem("1903");

  • Import Package problems and error in the Java file created in runtime

    got the following error message when i try to load the JSP file given below (FlightSearch.jsp). Given also below the JAVA files (flightsearch$jsp.java) created by the compiler.
    Thanks for your help
    Susan
    Error message
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:320: 'catch' without 'try'.
    } catch (Throwable t) {
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: 'try' without 'catch' or 'finally'.
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: '}' expected.
    ^
    3 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)
    FlightSearch.jsp
    <%@page import="java.util.*" errorPage="ErrorHandler.jsp"%>
    <%@page import="com.client.entity.Flight"%>
    <%@page import="com.client.wsclient.FlightServiceClient"%>
    <H3>Available Flight List</H3>
    <br>We have found the following Available flight(s) : </br>
    <table border="0" cellpadding="0" cellspacing="0" width="100">
    <tr>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Company</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Number</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Depart From<font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrive</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Adult Fare</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Child Fare</font></b></td>
    </tr>
    <%
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getDestination()%></td>
    <td width= "10%"><%=flt.getArrive()%></td>
    <td width= "10%"><%=flt.getFrDate()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getToDate()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    %>
    <td width= "10%"><%=tot_A%></td>
    <td width= "10%"><%=tot_C%></td>
    </tr>
    <%
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getFlightDpt()%></td>
    <td width= "10%"><%=flt.getFlightArr()%></td>
    <td width= "10%"><%=flt.getFlightDptDt()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getFlightArrDt()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    %>
    <td width= "10%"><%=totA%></td>
    <td width= "10%"><%=totC%></td>
    </tr>
    <%
    %>
    </table>
    flightsearch$jsp.java
    package org.apache.jsp;
    import java.util.*;
    import com.client.entity.Flight;
    import com.client.wsclient.FlightServiceClient;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import org.apache.jasper.runtime.*;
    public class flightsearch$jsp extends HttpJspBase {
    static {
    public flightsearch$jsp( ) {
    private static boolean jspxinited = false;
    public final void jspxinit() throws org.apache.jasper.runtime.JspException {
    public void _jspService(HttpServletRequest request, HttpServletResponse response)
    throws java.io.IOException, ServletException {
    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    String _value = null;
    try {
    if (_jspx_inited == false) {
    synchronized (this) {
    if (_jspx_inited == false) {
    jspxinit();
    jspxinited = true;
    _jspxFactory = JspFactory.getDefaultFactory();
    response.setContentType("text/html;ISO-8859-1");
    pageContext = _jspxFactory.getPageContext(this, request, response,
    "ErrorHandler.jsp", true, 8192, true);
    application = pageContext.getServletContext();
    config = pageContext.getServletConfig();
    session = pageContext.getSession();
    out = pageContext.getOut();
    // HTML // begin [file="/client/flightsearch.jsp";from=(0,59);to=(1,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(1,43);to=(2,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(2,58);to=(19,0)]
    out.write("\r\n\r\n<H3>Available Flight List</H3>\r\n<br>We have found the following Available flight(s) : </br>\r\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100\">\r\n <tr>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Company</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Number</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Depart From<font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrive</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Adult Fare</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Child Fare</font></b></td>\r\n </tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(19,2);to=(66,0)]
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(66,2);to=(68,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(68,21);to=(68,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(68,42);to=(69,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(69,21);to=(69,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(69,41);to=(70,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(70,21);to=(70,41)]
    out.print(flt.getDestination());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(70,43);to=(71,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(71,21);to=(71,36)]
    out.print(flt.getArrive());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(71,38);to=(72,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(72,21);to=(72,36)]
    out.print(flt.getFrDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(72,38);to=(73,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(73,21);to=(73,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(73,43);to=(74,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(74,21);to=(74,36)]
    out.print(flt.getToDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(74,38);to=(75,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(75,21);to=(75,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(75,43);to=(76,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(76,3);to=(87,1)]
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(87,3);to=(88,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(88,21);to=(88,26)]
    out.print(tot_A);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(88,28);to=(89,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(89,21);to=(89,26)]
    out.print(tot_C);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(89,28);to=(91,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(91,2);to=(100,0)]
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(100,2);to=(102,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(102,21);to=(102,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(102,42);to=(103,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(103,21);to=(103,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(103,41);to=(104,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(104,21);to=(104,39)]
    out.print(flt.getFlightDpt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(104,41);to=(105,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(105,21);to=(105,39)]
    out.print(flt.getFlightArr());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(105,41);to=(106,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(106,21);to=(106,41)]
    out.print(flt.getFlightDptDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(106,43);to=(107,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(107,21);to=(107,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(107,43);to=(108,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(108,21);to=(108,41)]
    out.print(flt.getFlightArrDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(108,43);to=(109,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(109,21);to=(109,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(109,43);to=(110,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(110,3);to=(120,1)]
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(120,3);to=(121,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(121,21);to=(121,25)]
    out.print(totA);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(121,27);to=(122,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(122,21);to=(122,25)]
    out.print(totC);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(122,27);to=(124,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(124,2);to=(126,0)]
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(126,2);to=(127,8)]
    out.write("\r\n</table>");
    // end
    } catch (Throwable t) {
    if (out != null && out.getBufferSize() != 0)
    out.clearBuffer();
    if (pageContext != null) pageContext.handlePageException(t);
    } finally {
    if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);

    You are missing a closing parens. You have :
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){Which opens two parens but you only have one closing parens
    </tr>
    <%
    %>
    </table>

  • Problem in importing package

    i am new to java and facing problems in importing package which are self made.
    secondly does JDK 1.1.3 can support swing

    Hi,
    I had some problems myself. I will add few lines, maybe it helps:
    OK, let's assume that you work in a directory. In this case, set classpath to this hierarchy as well as to "." ('this' hierarchy - like in DOS).
    Now, assume that you want to use packages MyPack1 and MyPack2. The source files of classes belonging to MyPack1 must:
    - start with command
    package MyPack1;
    - be located all in the directory MyPack1
    (and the same for MyPack2, of course)
    If you want to use MyPack1 within MyPack2, you have to include:
    import MyPack1.*;
    even though MyPack1 is, in fact, located on path: ../MyPack1/*
    (trust the classpath is important here)

  • Visual age problem - importing packages

    Hello,
    I have created a Java client NT application on Visual Age which interacts with Oracle database thru JDBC driver.
    when i give
    import oracle.jdbc.driver.*;
    the visual age editor is not able to find the above package, whereas when i export the same application and execute it on DOS environment there are no problems.
    I want to know the best way to import packages in Visual Age because when I added the required packages to my application, "no suitable driver" error occurred.
    Not as familiar with Visual Age. Any help would be appreciated. Thanks :-)
    Raj

    Thanks! Got it fixed.
    Giving the duke dollar to myself ;)
    raj

  • Problem importing packages via ICE??

    Hello,
    I am running Portal 6.0 on Windows Server. For one of the business package that is to be implemented in my Portal, i have to deploy two files as a pre-requisite that are associated with SAP Note 660777(https://service.sap.com/sap/support/notes/660777). I have imported the "com.sap.pct.crm.kmconfig40.par" file but having problems deploying "fullupdate_completeBP602.zip". I must admit that i haven't got much idea about importing packages via ICE as i have never used it before.
    I tried to import it via, Portal->System Administration->System Configuration. In there, Actions->Import. When i point to the "fullupdate_completeBP602.zip" file and say Preview, i get a error message saying "Enter a valid configuration archive name". Isn't this the right way to import this package? Please guide. Thanks.
    Regards,

    I suggest you also ask in the KM forum about ICE. There is also some information in the SAP help pages about ICE. For example an overview of it can be found
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/63/42aa17425c514f85ad5ecd45988509/frameset.htm">here</a>
    Cheers

  • Error while running import package

    Hi,
    Transformation file was validated successfully. But after running import package i am having following error on MS-BPC-7.0.
    Invalid character in the given encoding. Line 1, position 1.
    When i try validate and process trans file i am having the following error message. But same data file and same trans file was working till couple of days ago. After that whatever changes i have made to file, i did revert them to have it working like beofre.
    Warning: Some records were rejected.
    Rejected records reference either calculated members or invalid members.
    Actually rejected record is only, one, but even other data was not loaded.
    Thanks in advance for sharing your ideas or similar experiences.
    Thanks,
    KK

    Hi,
    There is definitely some problem with one of the records there. Do you have header? What is the delimiter? Do you have the same delimiter in the transformation file? You need to take a look at all the possibilities.
    Hope this helps.

  • Java import statement problems

    Hello...
    I have the book "Java in a Nutshell, 2nd ed" and have a query about a nested top-level interface example they have in the book.
    Basically there's two files/classes. The first, LinkedList.java, is as follows:
    public class LinkedList {
        public static interface Linkable {
            // Linkable interface details here
        // rest of LinkedList class here
    Next is LinkedList.java as follows:
    import LinkedList.*;
    class LinkableInteger2 implements Linkable {
        // rest of LinkableInteger2 class here
    Now I thought the import statement had two forms - and both used a package name as part of the statement:
    import package.class;
    import package.*;
    Obviously, neither class has a package statement.
    As written, these classes do not compile. Am I right in assuming the lack of a package name is causing this problem, or is there something else going on here?
    Thanks...
    Mark.

    Since you don't have package statements in the files, the classes are being placed in the default package. You cannot explicitly import classes from the default package. Al classes in the default package, the java.lang package and the current package are always imported automatically. Your import statement is incorrect - remove it.

  • Import package from one project into another

    Hello everyone,
    I have some projects.
    An enterprise and war project created in netbeans.
    I would like to use some files from one project to another. when I import
    the package I get the error-
    'package x does not exist'
    I have added the package to the project but I still get the error.
    I have also added the project to import to my glasspath but still.
    E.g.
    set classpath
    .;c:\enterpriseA;
    My next idea is to create a war project into my enterprise project and copy the files
    from the war project into it in order to use it. But I'm sure there is a better way.
    THanking you in advance.
    eve
    Edited by: evepokua on Nov 22, 2009 1:44 PM

    One mistake I keep making is that I don't add the package to the
    Dependencies of the plugin I'm writing. You have to go to plugin.xml,
    and add the package you depend on to the Dependencies section. Maybe you
    didn't do this?
    Michael
    nasti wrote:
    > Hello everybody!
    > I am new user of osgi and eclipse. I tried to do some of Oscar examples
    > but I had some problems. Namely, the problem in import of package from
    > one project into another in Eclipse.
    > I add first project to the Build Path of the second one.
    > I add to the first project manifest line: Export-Package example2.service.
    > I add to the second project manifest line: Import-Package example2.service.
    > But when I tried to execute these bundles the
    > java.lang.NoClassDefFoundError was occurred. May be you will help me
    > with this problem.
    > Thanks....
    >
    >

  • Import package error in SAP BPC 4.1

    Hi,
    Can anyone please assist.
    I tried running the import package several times on bpc ver 4.1 without aby success. I even tripple checked Users and Security and it validated successfully but the package still crashes in the middle of processing.
    The error message read:
    [Package Result = Error]
    Package:                    Import
    Appset:                       CQS
    Application:                 FIXEDCOST
    Request Time:             2009-06-23 13:44:42
    Start   Time:                2009-06-23 13:44:42
    End     Time:               2009-06-23 13:48:51
    Total   Time:                00:04:09
    TOTAL STEPS  3
    1. Assign initial parameters:        completed  in 0 sec.
    2. Convert data:                     completed  in 7 sec.
    3. Load and process:                 Failed  in 241 sec.
    [Selection]
    FILE= DATAMANAGER\DATAFILES\CQSSA\2009\Fixed Costs Testnew.txt
    TRANSFORMATION= DATAMANAGER\TRANSFORMATIONFILES\CQSSA\FC_Trans_ZA_ACT.xls
    CLEARDATA= Yes
    RUNLOGIC= No
    [Member Selection]
    CATEGORY: ACTUAL
    ENTITY: SQSSA
    TIME: 2009.MAY
    [The list of conversion file in each transformation file]
    Transformation file: DATAMANAGER\TRANSFORMATIONFILES\CQSSA\FC_Trans_ZA_ACT.xls
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!FCOSTACCOUNT
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!FCOSTCENTRE
         - Conversion file : ConversionFiles\CQSSA\FC_CONV_ZA.XLS!MARKETS
    [Messages]
    FIXEDCOST
    Failed
    Submit Count  : 15278 (Record count in source file  : 20056)
    Accept Count : 0
    Reject Count : 15278
    You do not have WRITE authority.::ACTUAL
    Where can I enable WRITE authority?

    Hi Vishal Mahawadhi,
    Thank you for replying. I've tried all your suggestions before I even logged the query. I even went to analysis manager, gave access to the application and processed the cube but still that didn't help.
    But I noticed that I only have read access when I look at the settings on the roles in analysis manager. The problem is that I can't change the settings to read/write. Version 4.1 is a mess.

  • Import package needs to show extra info in the log.

    Hi,
    I have a problem regarding an import package.
    I am trying to edit in a way, that in the package log I get details about for which entity, time and category the import has run. Is this possible?
    Regards, Tim Vierhout

    Yes I know about this, but customer is coming from V4, where they had a log for which ENTITY/CATEGORY/Time period the import has run. And also when import ran without errors.
    I have already created a workaround with adding a logic task to the import containing a logic which writes no records but does return a member selection log, only I was wondering if there was a easier way to get the same result.
    -Tim

  • Import package does not exist  java

    Hi ,
    i try to compile as following
    javac -cp "myapplication.jar:." modelapp.java
    my batch file as follwong
    set PATH=C:\Program Files\Java\jdk1.6.0_32\bin;C:\Users\DELL\Downloads\myfolder;C:\Users\DELL\Downloads\myfolder\edu;
    set CLASSPATH=C:\Program Files\Java\jdk1.6.0_32\bin;C:\Users\DELL\Downloads\myfolder;C:\Users\DELL\Downloads\myfolder\edu;
    cd C:\Users\DELL\Downloads\Stanfordnew
    but the error appear as following
    package edu.appli.machr. doesn't exist
    import package edu.appli.machr. doesn't exist
    i have already add the package to classpath
    please help me in how can i solve this problem.
    tHANKS

    javac -cp "myapplication.jar:." modelapp.java You compile on Linux and run on Windows or something? That is the Linux classpath, on Windows the list separator is ; If you do everything on Windows I'm a bit amazed it worked.
    set CLASSPATH=C:\Program Files\Java\jdk1.6.0_32\bin;C:\Users\DELL\Downloads\myfolder;C:\Users\DELL\Downloads\myfolder\edu;You made a copy/paste mistake, the classpath contains the path.
    please help me in how can i solve this problem.Research what the classpath actually is. Google can easily provide you plenty of articles describing it.

  • Error running import package: it removes the journals

    Hello experts,
    I have a problem when I run the import package using the "Replace&Clear "data option. Apart from clearing the INPUT data, it clears the journals. When the package ends running, the previous data is correctly cleared, the new data correctly introduced, but the journals that were posted before running the package are not posted any more. I would like to know where could I change this option so that it work's properly, not affecting journals. 
    Thank you,
    Álvaro

    Journal are posted but the main problem is that you clear all the values for all category, entity, time (including values for data source journal).
    That's means into database were inserted records with oposite values for all configuration (category.ebtity, time from that import file).
    You have two solution:
    1. Use work status to avoid any DM packages run after Journal posted.
    2. Modify the Import packages to avoid clear of the values for Journal (see the clear package).
    Regards
    Sorin Radulescu

Maybe you are looking for

  • My contacts won't open so I can add email addresses

    my contacts app won't open for me to add emails can someone please help me

  • Few questions about unibody

    So im getting rid of my white 2,16 this week and then getting a new unibody macbook 2 weeks from now. Im not sure which model im getting yet but most likely the 2.4ghz one. I have a few questions to ask that have kept me a bit curious. 1.How strong i

  • Any good way to access a folder of hmtl files in weblogic server hard disk

    I know that I can deploy a .war file containing some html and WEB-INF/web.xml file etc. to weblogic server, and then access the webpages in that .war file. But is there any more convenient way to be able to lift the restriction of having to put those

  • Use more than one song on slideshow?

    When it comes to both Final Cut Pro HD vs. Final Cut Express HD... With either one can you use more than one iTune song when making a picture slideshow? I currently just use iMovie to do this but with iMovie I can only use one song. Considering upgra

  • Adding more than one video effect

    I have a short clip that I want to give both the "aged film" look to as well as make it black and white. Both these effects are available under Window > Clip Adjustments, but I can't figure out if it's possible to use both at the same time. Anyone kn