Finished writing amazing code that compiles but won't run properly

I finished writing this code for someone and it compiles but it does not run properly. Anyone see any problems? Any help would be gladly appreciated.
/* Program is for the Coconut Grove Palace Building. This program keeps track of the building occupants and the maintenance for each tenant using a simple menu system. */
import java.util.Scanner;
public class Grove {
private static Scanner keyboard = new Scanner(System.in);
/* Declaring values that will not change throughout the program. The plus one is so that people don't get confused */
private static final int TOTAL_BUILDING_MAX = 16 + 1;
private static final int TOTAL_FLOOR_MAX = 8 + 1;
private static final int APARTMENT_MAX = 4 + 1;
public static void main (String[] args) {
// Declare main variable
     int cocoPalace[][] = new int[2][3];
     char menuChoice;
     int aptNumber = 0;
     int floorNumber = 0;
     int totalFloor = 0;
     int totalBuilding = 0;
//Fill up the array with the original amount of 2 people per apartment
     for (int dex = 0; dex <3; dex++)
               cocoPalace[0][dex] = 2;
               cocoPalace[1][dex] = 2;     
     System.out.println("Welcome to the coconut grove palace");
//Main part of the program that is essentially the menu screen.     
     do
          //method that calculates the maintenance that will be used several times
          double buildingMaintenance = calculateMaintenance(cocoPalace);
          //Menu System using a switch command with nested for loops and other code.
               System.out.println("(A)partment, (B)uilding, (P)eople, E(x)it");
               menuChoice = keyboard.nextLine().charAt(0);
                    switch (menuChoice)     
//FIRST CASE 'A' ASK FOR THE FLOOR AND APARTMENT NUMBER AND DISPLAYS THE MAINTENANCE COST FOR IT
               case 'a':
               //Idiot proof 1
               System.out.println("Please enter floor number :");
               floorNumber = keyboard.nextInt();
               while (floorNumber > 2)
               System.out.println("Floor number must be between 1 and 2. Try again:");
               floorNumber = keyboard.nextInt();
               //Idiot proof 2               
               System.out.println("Please enter apartmentNumber :");
               aptNumber = keyboard.nextInt();
               while (aptNumber > 3)
               System.out.println("Apartment number must be between 1 and 3. Try again:");
               aptNumber = keyboard.nextInt();
               System.out.println("Floor number" + cocoPalace[floorNumber] + "Apartment number" + cocoPalace[floorNumber][aptNumber] + " : " + buildingMaintenance);
               break;
//SECOND CASE 'B' REPORTS THE OCCUPANCY AND MAINTENANCE FOR THE WHOLE BUILDING
               case 'b':
               for (int dex2 = 0; dex2 < 3; dex2++)
               System.out.println("Floor number 1 Apartment number " + cocoPalace[0][dex2] + " : " + buildingMaintenance);                    
               for (int dex3 = 0; dex3 < 2; dex3++)
               System.out.println("Floor number 2 Apartment number " + cocoPalace[1][dex3] + " : " + buildingMaintenance);                    
               break;
/*THIRD CASE 'P' ALLOWS THE USER TO CHANGE THE AMOUNT OF PEOPLE IN AN APARTMENT AND RECALCULATES THE MAINTENACE. IT IS ALSO "IDIOT PROOFED" SO THAT VALUES DO NOT EXCEED THE REGULATIONS OF THE BUILDING IT SELF */
               case 'p':
               //Idiot proof 1
               System.out.println("Please enter floor number : ");
               floorNumber = keyboard.nextInt();
               while (floorNumber > 3)
               System.out.println("Floor number must be between 1 and 2. Try again: ");
               floorNumber = keyboard.nextInt();
               //Idiot proof 2               
               System.out.println("Please enter apartment number : ");
               aptNumber = keyboard.nextInt();
               while (aptNumber > 4)
               System.out.println("Apartment number must be between 1 and 3. Try again: ");
               aptNumber = keyboard.nextInt();
               //Idiot proof 3 with the amount of people being added at the same time.
               System.out.println("How many people will there be : ");
               int amountPeople = keyboard.nextInt();
               cocoPalace[floorNumber][aptNumber] = amountPeople;
               while (amountPeople > APARTMENT_MAX || totalBuilding > TOTAL_BUILDING_MAX || totalFloor > TOTAL_FLOOR_MAX )
          System.out.print("Too many people in building. Please try again : ");
               amountPeople = keyboard.nextInt();
                    cocoPalace[floorNumber][aptNumber] = amountPeople;
               break;
     while (menuChoice != 'x'|| menuChoice != 'a' || menuChoice != 'p' || menuChoice != 'b');
//Method to calculate maintenance.
private static double calculateMaintenance(int cocoPalace[][])
     int amountPeople = 0;
     for (int dex4 = 0; dex4 < 2; dex4++)
               amountPeople += cocoPalace[0][dex4];
               amountPeople += cocoPalace[1][dex4];
               cocoPalace[0][dex4] = 2;
               cocoPalace[1][dex4] = 2;     
          double buildingMaintenance = 5000/(amountPeople);
     return(buildingMaintenance);
}

ok the array problem is fixed i was having a simple "one off" mistake when accessing the array.
As for the error that i keep getting. I honestly can't see where the problem with this is in code.
The it cant be equalt to nothing because this is written so that it has to equal a letter before the program actually runs through everything. Thanks again for the help
here is the error that i am getting when the program runs.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:558)
at Grove.main(Grove.java:46)
Here is the code with the new corrections.
/* Program is for the Coconut Grove Palace Building. This program keeps track of the building occupants and the maintenance for each tenant using a simple menu system. */
import java.util.Scanner;
public class Grove {
private static Scanner keyboard = new Scanner(System.in);
/* Declaring values that will not change throughout the program. The plus one is so that people don't get confused */
private static final int TOTAL_BUILDING_MAX = 16 + 1;
private static final int TOTAL_FLOOR_MAX = 8 + 1;
private static final int APARTMENT_MAX = 4 + 1;
public static void main (String[] args) {
// Declare main variable
     int cocoPalace[][] = new int[2][3];
     char menuChoice;
     int totalFloor = 0;
     int totalBuilding = 0;
//Fill up the array with the original amount of 2 people per apartment
     for (int dex = 0; dex <3; dex++)
               cocoPalace[0][dex] = 2;
               cocoPalace[1][dex] = 2;     
     System.out.println("Welcome to the coconut grove palace");
//Main part of the program that is essentially the menu screen.     
     do
     //Variables intialized
     int aptNumber = 0;
     int floorNumber = 0;
          //method that calculates the maintenance that will be used several times
          double buildingMaintenance = calculateMaintenance(cocoPalace);
          //Menu System using a switch command with nested for loops and other code.
               System.out.println("(A)partment, (B)uilding, (P)eople, E(x)it");
               menuChoice = keyboard.nextLine().charAt(0);
                    switch (menuChoice)     
//FIRST CASE 'A' ASK FOR THE FLOOR AND APARTMENT NUMBER AND DISPLAYS THE MAINTENANCE COST FOR IT
               case 'a':
               //Idiot proof 1
               System.out.println("Please enter floor number     :");
               floorNumber = keyboard.nextInt();
               while (floorNumber > 2)
               System.out.println("Floor number must be between 1 and 2. Try again:");
               floorNumber = keyboard.nextInt();
               //Idiot proof 2               
               System.out.println("Please enter apartmentNumber  :");
               aptNumber = keyboard.nextInt();
               while (aptNumber > 3)
               System.out.println("Apartment number must be between 1 and 3. Try again:");
               aptNumber = keyboard.nextInt();
               System.out.println("Floor number" + cocoPalace[floorNumber] + "Apartment number" + cocoPalace[floorNumber - 1][aptNumber - 1] + "  :  " + buildingMaintenance);
               break;
//SECOND CASE 'B' REPORTS THE OCCUPANCY AND MAINTENANCE FOR THE WHOLE BUILDING
               case 'b':
               for (int dex2 = 0; dex2 < 3; dex2++)
               System.out.println("Floor number 1 Apartment number  " + cocoPalace[0][dex2] + "  :  " + buildingMaintenance);                    
               for (int dex3 = 0; dex3 < 2; dex3++)
               System.out.println("Floor number 2 Apartment number  " + cocoPalace[1][dex3] + "  :  " + buildingMaintenance);                    
               break;
/*THIRD CASE 'P' ALLOWS THE USER TO CHANGE THE AMOUNT OF PEOPLE IN AN APARTMENT AND RECALCULATES THE MAINTENACE. IT IS ALSO "IDIOT PROOFED" SO THAT VALUES DO NOT EXCEED THE REGULATIONS OF THE BUILDING IT SELF */
               case 'p':
               //Idiot proof 1
               System.out.println("Please enter floor number     : ");
               floorNumber = keyboard.nextInt();
               while (floorNumber > 2)
               System.out.println("Floor number must be between 1 and 2. Try again: ");
               floorNumber = keyboard.nextInt();
               //Idiot proof 2               
               System.out.println("Please enter apartment number : ");
               aptNumber = keyboard.nextInt();
               while (aptNumber > 3)
               System.out.println("Apartment number must be between 1 and 3. Try again: ");
               aptNumber = keyboard.nextInt();
               //Idiot proof 3 with the amount of people being added at the same time.
               System.out.println("How many people will there be : ");
               int amountPeople = keyboard.nextInt();
               cocoPalace[floorNumber - 1][aptNumber - 1] = amountPeople;
               while (amountPeople > APARTMENT_MAX || totalBuilding > TOTAL_BUILDING_MAX || totalFloor > TOTAL_FLOOR_MAX  )
                      System.out.print("Too many people in building. Please try again : ");
                           amountPeople = keyboard.nextInt();
                    cocoPalace[floorNumber - 1][aptNumber - 1] = amountPeople;
               break;
     while (menuChoice != 'x'|| menuChoice != 'a' || menuChoice != 'p' || menuChoice != 'b');
//Method to calculate maintenance.
private static double calculateMaintenance(int cocoPalace[][])
     int amountPeople = 0;
     for (int dex4 = 0; dex4 < 2; dex4++)
               amountPeople += cocoPalace[0][dex4];
               amountPeople += cocoPalace[1][dex4];
               cocoPalace[0][dex4] = 2;
               cocoPalace[1][dex4] = 2;     
          double buildingMaintenance = 5000/(amountPeople);
     return(buildingMaintenance);
}

Similar Messages

  • Dive Log Part 3 will compile but won't run

    I need help I am a newbie doing this assignment for class. I am having problems with the Dive Log part 3 tutorial parts 1 & 2 went fine but 3 has given me problems. After fixing all errors to Diver.java, Divelog.java finally compiled then I went to run it and i get a list of errorssome from Diver some from DiveLog. Any help figuring out this mystery would be helpful.

    Ah you have PPC version. Either you can keep using Firefox 3.6.* are try a third party version of Firefox 4.0.* at http://www.floodgap.com/software/tenfourfox/
    The Firefox 4.0 and newer downloads contains the 32-bit and 64-bit version for Intel at moment.

  • Old C socket program compiles, but doesn't run properly

    I have an old C program that uses sys/ipc.h to listen on ports 6666 and ports 6669 for user requests. I have determined that the
    program gets to the 'accept' call without error. The return from accept(sockfd, (struct sockaddr *) &cli_addr, &cli_addrlen) is zero
    indicating success. Nevertheless, something is wrong, because netstat -a shows nothing listening on either 6666 or 6669, and
    telnet to these two ports fails as well.
    I've compiled and run the program on Sparc 8 and 9. It is the i86pc architecture I am having a problem with. I tried having root
    run it in the global zone in order to eliminate zones as a factor with no success.
    This program also uses threads (thread.h) and rpc (rpc.h). Has anyone seen this problem? Does anyone have a suggestion?
    George

    Hi Darren:
    Thanks for your prompt supply. I saw no alternative but to start pulling the code apart and I believe I have a solution. I think big-endian as opposed to
    little-endian definitely has something to do with it.
    Here's what I had to change to make this work:
    Original Code: serv_addr.sin_port = htonl(port);
    Modified Code: serv_addr.sin_port = htons((short) port);
    Converting the port to a short seems to have fixed things. The original code converted the port to a long.

  • TS3002 My macbook pro 4,1 runs os x 10.6 but won't run my apple usb superdrive. One forum said that this is due to os x, not hardware. The terminal commands given were for Lion, but don't work in snow leopard. Help!

    My macbook pro 4,1 runs os x 10.6 but won't run my apple usb superdrive. One forum said that this is due to os x, not hardware. The terminal commands given were for Lion, but don't work in snow leopard. Help!

    I was able to get it to work!

  • Hi - Have a Javascript (search) that was ok thru 9, but won't run in X. Thank you.

    Hi - Have a Javascript (search) that was ok thru 9, but won't run in X. Thank you

    Quoting the Acrobat X SDK:
    Changes to search object
    The following changes have been made to the "search" object properties:
    ● The thesaurus and soundex properties have been removed
    ● The legacySearch property is now deprecated and always returns false.
    Changes to SearchExecuteQuery
    The following have been removed from nWordOptions parameter of SearchExecuteQuery:
    ● kWordOptionSoundsLike
    ● kWordOptionThesaurus
    The function SearchIsLegacySearchAvailable has been deprecated and will always return false.

  • It compiles but can't run it!

    Hi
    I am really new to java. I got this code from net and tried to compile it. Idoes compile but when i run it , i get the messege,
    "java.lang.NoSuchMethodError: main
    Exception in thread "main" .
    Here is me code.Can someone pleaese tell me y i can't run it and how to fix it. Thanks for your time.
    import java.awt.*;
    import java.awt.event.*;
    public class calculator extends java.applet.Applet implements ActionListener {
         TextField txtTotal = new TextField("");
    Button button[] = new Button[10];
         Button divide = new Button("/");
         Button mult = new Button("*");
         Button plus = new Button ("+");
         Button minus = new Button("-");
         Button isequalto = new Button("=");
         Button clear = new Button("CA");
         double num ,numtemp ;
         int counter;
         String strnum = "",strnumtemp = "" ;
         String op = "";
         public void operation() {
         counter ++;
              if (counter == 1) {
              numtemp = num;      
              strnum = "";
              num = 0;
              }else{
              if (op == "+") numtemp += num;
              else if (op == "-") numtemp -= num;
              else if (op == "*") numtemp = numtemp * num;
              else if (op == "/") numtemp = numtemp / num;
              strnumtemp = Double.toString(numtemp);
              txtTotal.setText(strnumtemp);          
              strnum = "";
              num = 0;     
         public void init() {
         setLayout(null);
         plus.setBackground(Color.blue);
         plus.setForeground(Color.white);
    minus.setBackground(Color.blue);
         minus.setForeground(Color.white);
    divide.setBackground(Color.blue);
         divide.setForeground(Color.white);
         isequalto.setBackground(Color.blue);
         isequalto.setForeground(Color.white);
         mult.setBackground(Color.blue);
         mult.setForeground(Color.white);
         clear.setBackground(Color.blue);
         clear.setForeground(Color.red);
         for(int i = 0;i <= 9; i ++) {
              button[i] = new Button(String.valueOf(i));
              button.setBackground(Color.orange);
              button[i].setForeground(Color.blue);
         button[1].setBounds(0,53,67,53);
         button[2].setBounds(67,53,67,53);
         button[3].setBounds(134,53,67,53);
         button[4].setBounds(0,106,67,53);
         button[5].setBounds(67,106,67,53);
         button[6].setBounds(134,106,67,53);
         button[7].setBounds(0,159,67,53);
         button[8].setBounds(67,159,67,53);
         button[9].setBounds(134,159,67,53);
         for (int i = 1;i <= 9; i ++) {
              add(button[i]);
         txtTotal.setBounds(0,0,200,53);
         add(txtTotal);
         plus.setBounds(0,212,67,53);
         add(plus);
         button[0].setBounds(67,212,67,53);
         add(button[0]);
         minus.setBounds(134,212,67,53);
         add(minus);
         divide.setBounds(134,264,67,53);
         add(divide);
         isequalto.setBounds(67,264,67,53);
         add(isequalto);
         mult.setBounds(0,264,67,53);
         add(mult);
         add(clear);
         public void start() {
         for(int i = 0;i <= 9; i ++) {
              button[i].addActionListener(this);
         plus.addActionListener(this);
         minus.addActionListener(this);
         divide.addActionListener(this);
         mult.addActionListener(this);
         isequalto.addActionListener(this);
         clear.addActionListener(this);
         public void stop() {
         for(int i = 0;i <= 9; i ++) {
              button[i].addActionListener(null);
         plus.addActionListener(null);
         minus.addActionListener(null);
         divide.addActionListener(null);
         mult.addActionListener(null);
         isequalto.addActionListener(null);
         clear.addActionListener(null);
         public void actionPerformed(ActionEvent e) {
              for(int i = 0;i <= 9; i++) {
                   if (e.getSource() == button[i]) {
                   play(getCodeBase(),i + ".au");
                   strnum += Integer.toString(i);
                   txtTotal.setText(strnum);
                   num = Double.valueOf(strnum).doubleValue();
    if (e.getSource() == plus) {
              operation();
              op = "+";
              if (e.getSource() == minus) {
              operation();
              op = "-";
              if (e.getSource() == divide) {
              operation();     
              op = "/";
              if (e.getSource() == mult) {
              operation();     
              op = "*";
              if (e.getSource() == isequalto) {
              if (op == "+") numtemp += num;
              else if (op == "-") numtemp -= num;
              else if (op == "*") numtemp = numtemp * num;
              else if (op == "/") numtemp = numtemp / num;
              strnumtemp = Double.toString(numtemp);
              txtTotal.setText(strnumtemp);
              strnumtemp = "";
              numtemp = 0;
              strnum = "";
              num = 0;
              counter = 0;
              if (e.getSource() == clear) {
              txtTotal.setText("0");
              strnumtemp = "";
              numtemp = 0;
              strnum = "";
              num = 0;
              counter = 0;

    Thanks for your reply.
    Ok i used the link that you sent me and saved the following in the same directory where i have "calcultor.class".
    <HTML>
    <HEAD>
    <TITLE> A Simple Program </TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE="calculator.class" WIDTH=150 HEIGHT=25>
    </APPLET>
    </BODY>
    </HTML>
    I saved it with the name "calculator.html".
    Now when in my browser i type calculator.html, nothing happens.
    I am sure i am missing something but i don't know what.Can someone please help me!
    thanks

  • PLSQL compiles but doesn't run.. I've declared it everywhere but still..

    PLSQL compiles but doesn’t run.. I’ve declared it everywhere but still..
    Afternoon.. Hopefully a quick one for someone.. I’m trying to run a Concurrent Program in ORACLE Financials using a Data Template derived BI Publisher report.
    Error message received..
    SUBIXCLT module: UofS Expense Claim Tracking Report
    +--------------------------------------------------------------------------
    All Parameters: raisedby=:status=:claimant=:expense_date_from=:expense_date_to=:LP_ORDERED_BY=Expense Report Number
    Data Template Code: SUBIXCLT
    Data Template Application Short Name: PO
    Debug Flag: N
    {raisedby=, claimant=, expense_date_to=, expense_date_from=, status=, LP_ORDERED_BY=Expense Report Number}
    Calling XDO Data Engine...
    [060410_025628319][][STATEMENT] Start process Data
    [060410_025628324][][STATEMENT] Process Data ...
    [060410_025628329][][STATEMENT] Executing data triggers...
    [060410_025628329][][STATEMENT] BEGIN
    SUBIXCLT.claimant := :claimant ;
    SUBIXCLT.expense_date_from := :expense_date_from ;
    SUBIXCLT.expense_date_to := :expense_date_to ;
    SUBIXCLT.raisedby := :raisedby ;
    SUBIXCLT.status := :status ;
    SUBIXCLT.lp_ordered_by := :lp_ordered_by ;
    :XDO_OUT_PARAMETER := 1;
    END;
    l_flag Boolean;
    BEGIN
    l_flag := SUBIXCLT.BEFOREREPORT(L_ORDERED) ;
    if (l_flag) then
    :XDO_OUT_PARAMETER := 1;
    end if;
    end;
    [060410_025628356][][EXCEPTION] SQLException encounter while executing data trigger....
    java.sql.SQLException: ORA-06550: line 4, column 33:
    PLS-00201: identifier 'L_ORDERED' must be declared
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignoredThe Data Template
    The Data Template
    <?xml version="1.0" encoding="utf-8" ?>
    - <dataTemplate name="UofS_OutstandngExpenses_Report" defaultPackage="SUBIXCLT" dataSourceRef="FINDEV" version="1.0">
    - <properties>
      <property name="xml_tag_case" value="upper" />
      <property name="include_parameters" value="true" />
      <property name="debug_mode" value="on" />
      </properties>
    - <parameters>
      <parameter name="claimant" dataType="character" defaultValue="" />
      <parameter name="expense_date_from" dataType="date" defaultValue="" />
      <parameter name="expense_date_to" dataType="date" defaultValue="" />
      <parameter name="raisedby" dataType="character" defaultValue="" />
      <parameter name="status" dataType="character" defaultValue="" />
      <parameter name="lp_ordered_by" dataType="character" defaultValue="" />
      </parameters>
    - <dataQuery>
      <dataTrigger name="beforeReportTrigger" source="SUBIXCLT.BEFOREREPORT(L_ORDERED)" />
    - <sqlStatement name="Q1">
    - <![CDATA[
    SELECT DISTINCT
    erh.invoice_num,
    pap.full_name EMP_CLAIMING,
    DECODE(NVL(erh.expense_status_code, 'Not yet Submitted (NULL)'), 'CANCELLED', 'CANCELLED',
         'EMPAPPR', 'Pending Individuals Approval',      'ERROR', 'Pending System Administrator Action',
         'HOLD_PENDING_RECEIPTS     ', 'Hold Pending Receipts', 'INPROGRESS', 'In Progress', 'INVOICED', 'Ready for Payment',
         'MGRAPPR', 'Pending Payables Approval', 'MGRPAYAPPR', 'Ready for Invoicing', 'PAID', 'Paid',
         'PARPAID', 'Partially Paid',     'PAYAPPR', 'Payables Approved',     'PENDMGR', 'Pending Manager Approval',
         'PEND_HOLDS_CLEARANCE', 'Pending Payment Verification',     'REJECTED', 'Rejected',     'RESOLUTN',     'Pending Your Resolution',
         'RETURNED',     'Returned',     'SAVED',     'Saved',     'SUBMITTED',     'Submitted',     'UNUSED',     'UNUSED',
         'WITHDRAWN','Withdrawn',     'Not yet Submitted (NULL)') "EXPENSE_STATUS" ,
    NVL(TO_CHAR(erh.report_submitted_date,'dd-MON-yyyy'),'NULL') SUBMIT_DATE,
    NVL(TO_CHAR(erh.expense_last_status_date,'dd-MON-yyyy'),'NULL') LAST_UPDATE,
    erh.override_approver_name ER_Approver,
    fu.description EXP_ADMIN,
    erh.total,
    erh.description 
    FROM
    AP_EXPENSE_REPORT_HEADERS_all erh,
    per_all_people_f pap, fnd_user fu
    WHERE erh.employee_id = pap.person_id
    AND fu.user_id = erh.created_by
    AND NVL(erh.expense_status_code, 'Not yet Submitted') NOT IN  ('MGRAPPR', 'INVOICED', 'PAID', 'PARPAID')
    AND pap.full_name = NVL(:claimant, pap.full_name)
    AND TRUNC(erh.report_submitted_date) BETWEEN NVL(:expense_date_from, '01-JAN-1999') AND NVL(:expense_date_to,'31-DEC-2299')
    AND fu.description = NVL(:raisedby,fu.description)
    AND erh.expense_status_code = NVL(:status,erh.expense_status_code) &LP_ORDERED_BY
      ]]>
      </sqlStatement>
      </dataQuery>
      <dataTrigger name="beforeReportTrigger" source="SUBIXCLT.BEFOREREPORT(L_ORDERED)" />
    - <dataStructure>
    - <group name="G_XP_CLM_TRACKNG" source="Q1">
      <element name="INVOICE_NUM" value="INVOICE_NUM" />
      <element name="EMP_CLAIMING" value="EMP_CLAIMING" />
      <element name="EXPENSE_STATUS" value="EXPENSE_STATUS" />
      <element name="SUBMIT_DATE" value="SUBMIT_DATE" />
      <element name="LAST_UPDATE" value="LAST_UPDATE" />
      <element name="LP_ORDERED_BY" dataType="varchar2" value="SUBIXCLT.LP_ORDERED_BY" />
      </group>
      </dataStructure>
      </dataTemplate>The PL SQL..
    The PL SQL..
    CREATE OR REPLACE PACKAGE Subixclt IS
    L_ORDERED  VARCHAR2(50);
    RAISEDBY VARCHAR2(50);
    STATUS VARCHAR2(50);
    CLAIMANT VARCHAR2(50);
    LP_ORDERED_BY VARCHAR2(50);
    FUNCTION BEFOREREPORT(L_ORDERED IN VARCHAR2) RETURN VARCHAR2;
    EXPENSE_DATE_FROM DATE;
    EXPENSE_DATE_TO DATE;
    --RETURN VARCHAR2;
    END;
    CREATE OR REPLACE PACKAGE BODY Subixclt IS
    FUNCTION BEFOREREPORT(L_ORDERED IN VARCHAR2)RETURN VARCHAR2 IS
    BEGIN
    Fnd_File.PUT_LINE(Fnd_File.LOG,'L_ORDERED'||L_ORDERED);
    DECLARE
    LP_ORDERED_BY VARCHAR2(50);
    L_ORDERED  VARCHAR2(50);
    RAISEDBY VARCHAR2(50);
    STATUS VARCHAR2(50);
    CLAIMANT VARCHAR2(100);
    EXPENSE_DATE_FROM DATE;
    EXPENSE_DATE_TO DATE;
    BEGIN
    IF (LP_ORDERED_BY='Expense Report Number') THEN
         LP_ORDERED_BY :='order by 1 asc;';
      ELSIF (LP_ORDERED_BY='Person Claiming') THEN
         LP_ORDERED_BY :='order by 2 asc;';
      ELSIF (LP_ORDERED_BY='Submit Date') THEN
      LP_ORDERED_BY :='order by 4 asc;';
      END IF;
    RETURN(L_ORDERED);
    --RETURN NULL;
    END;
    END;
    END;Thanks for looking..
    Steven
    Edited by: Mr_Alkan on Jun 4, 2010 3:35 PM

    One has to initialise a session first for use with Oracle Apps if you want to make it run as a concurrent job.
    Any decleration within your package will not be recognised unless initialisation is sucessful.
    Investigate the built-in packages:
    FND_GLOBAL - for initialisation
    FND_SUBMIT - for setting session relevant parameters
    -- function returns true or false depending on whether the initialisation was sucessful or not
    create or replace function is_Init_OK (p_User_Name       in varchar2
                                          ,p_Responsibility  in varchar2
                                          ,p_Language        in varchar2) return boolean as
      b_Set_NLS   boolean;
      b_Set_Mode  boolean;
      r_ISet      fnd_Init := Get_Init_Set(p_User_Name, p_Responsibility);
      begin
        -- 1
        fnd_global.apps_initialize(r_ISet.User_ID, r_ISet.Resp_ID, r_ISet.App_ID);
        -- 2
        b_Set_NLS := fnd_submit.set_nls_options(p_Language);
        -- 3
        b_Set_Mode  := fnd_submit.set_mode (false);
        return (b_Set_Mode and b_Set_NLS and (    (r_ISet.Resp_ID is not null)
                                              and (r_ISet.User_ID is not null)
        exception
          when others then
            return false;
    end is_Init_OK;
    -- for example
    declare
      l_User_ID number = 'IMPORT_POST'; --- import post user
      l_Resp    number =  'Import and Posting responsibility' -- import posting responsibility
      l_Language varchar2(100) := 'AMERICAN';
      b_Init boolean := false;
      INIT_EXCEPTION exception;
    begin
      b_Init := is_Init_OK(l_User_ID, l_Resp, l_Language);
      if (not b_Init) then
        raise INIT_EXCEPTION;
      end if;
      -- conitnue with your processing
      exception 
        when others then
          when INIT_EXECPTION then
          when others then
    end;
    /

  • Program compiles, but does not run

    To: XCode Users <[email protected]>
    From: Brigit Ananya <[email protected]>
    Subject: Program compiles, but does not run
    I am trying to port a Java application from the PC to the Mac. I am using XCode and the program compiles, but it does not run.
    When I try to run the ...app, I get the message that the main class is not specified, etc.
    When I try to run the ...jar, I do not get the message that the main class is not specified, but I do get the message that there is no Manifest section for bouncycastle, etc.
    Here are the detailed messages I get in the Console when I try to run the program:
    When I try to run the ...app, I get the following message:
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] [LaunchRunner Error] No main class specified
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] [JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] Exception in thread "main" java.lang.NullPointerException
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
    1/9/09 7:21:17 AM [0x0-0x8c08c].com.AnanyaSystems.AnanyaCurves[2253] at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
    When I try to run the ...jar, I do get the following message:
    1/9/09 7:22:43 AM [0x0-0x8d08d].com.apple.JarLauncher[2262] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] Exception in thread "main"
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] java.lang.SecurityException: no manifiest section for signature file entry org/bouncycastle/asn1/DEREnumerated.class
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:377)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:231)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.util.jar.JarVerifier.processEntry(JarVerifier.java:233)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.util.jar.JarVerifier.update(JarVerifier.java:188)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.util.jar.JarFile.initializeVerifier(JarFile.java:325)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.util.jar.JarFile.getInputStream(JarFile.java:390)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.misc.URLClassPath$JarLoader$1.getInputStream(URLClassPath.java:620)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.misc.Resource.cachedInputStream(Resource.java:58)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.misc.Resource.getByteBuffer(Resource.java:113)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.net.URLClassLoader.defineClass(URLClassLoader.java:249)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.security.AccessController.doPrivileged(Native Method)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    1/9/09 7:28:45 AM [0x0-0x8f08f].com.apple.JarLauncher[2277] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    I do specify the main class in both, the Manifest file and the Info.plist file, in the correct way, "package.MainClass". Is there another place where I need to specify it?
    Why do I need org/bouncycastle/asn1/DEREnumerated.class, and how would I have to specify it in Manifest?
    I also posted these questions at Mac Programming at forums.macrumors.com and at Xcode-users Mailing List at lists.apple.com/mailman/listinfo, but I did not get any answer.
    Please help! Thanks!

    There was something wrong with my Info.plist file.
    So, here is my corrected Info.plist file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
         <key>CFBundleDevelopmentRegion</key>
         <string>English</string>
         <key>CFBundleExecutable</key>
         <string>AnanyaCurves</string>
         <key>CFBundleGetInfoString</key>
         <string></string>
         <key>CFBundleIconFile</key>
         <string>AnanyaCurves.icns</string>
         <key>CFBundleIdentifier</key>
         <string>com.AnanyaSystems.AnanyaCurves</string>
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleName</key>
         <string>AnanyaCurves</string>
         <key>CFBundlePackageType</key>
         <string>APPL</string>
         <key>CFBundleShortVersionString</key>
         <string>0.1</string>
         <key>CFBundleSignature</key>
         <string>ac</string>
         <key>CFBundleVersion</key>
         <string>0.1</string>
         <key>Java</key>
         <dict>
              <key>JMVersion<key>
              <string>1.4+</string>
              <key>MainClass</key>
              <string>AnanyaCurves</string>
              <key>VMOptions</key>
              <string>-Xmx512m</string>
              <key>Properties</key>
              <dict>
                   <key>apple.laf.useScreenMenuBar</key>
                   <string>true</string>
                   <key>apple.awt.showGrowBox</key>
          <string>true</string>
              </dict>
         </dict>
    </dict>
    </plist>Ok, so now I can at least run the AnanyaCurves.jar file by double-clicking on it.
    However, I still cannot run the AnanyaCurves.app file. When I double-click on it, I get the following message in the Console:
    1/11/09 5:12:26 PM [0x0-0x67067].com.apple.JarLauncher[1128]  at ananyacurves.AnanyaCurves.main(AnanyaCurves.java:1961)
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137] [JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137] [LaunchRunner Error] No main class specified
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137] [JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137] Exception in thread "main" java.lang.NullPointerException
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
    1/11/09 5:13:11 PM [0x0-0x6a06a].com.AnanyaSystems.AnanyaCurves[1137]  at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)Why is it looking for the MRJApp.properties file? Isn't this outdated? Shouldn't it look for the Info.plist file? I do not have a MRJApp.properties file.
    Also, in the Run menu of my XCode project, Go, Run, and Debug are disabled, but perhaps this has to do with not being able to run the AnanyaCurves.app file.
    Thanks for your time! I really appreciate any help you can give me!

  • Photoshop elements 10 won't open, says files missing. Reinstall. Trying to reinstall but won't run. Nothing works. Using Windows 7.

    Photoshop elements 10 won't open, says files missing. Reinstall. Trying to reinstall but won't run. Nothing works. Using Windows 7.
    How do I reach tech support?

    http://forums.adobe.com/message/5506764#5506764

  • Kde 4.1 suddenly won't run properly

    I'm not sure what caused it, but KDE 4.1 suddenly won't run properly on one of my machines. It will start to run and die right at the point when the "splash screen" disappears. If I click the popup to make it go away, the desktop will appear for less than a second before being dropped out of X.
    The error message that I see after that is:
    xprop: unable to connect to display :0
    My main "DE" (Fluxbox) works perfectly, so I don't think that it's a problem with X itself.
    The video card brand is nVidia, if that helps any....

    If you're getting dropped out of X then it's X that's crashing.
    I will assume you have desktop effects enabled and they are causing your graphics driver to die somehow. You can disable desktop effects from the terminal by typing:
    kwriteconfig --file kwinrc --group Compositing --key Enabled --type bool false

  • I have bought a iPhone 4 , yesterday . I heard that iOS 7 is not running properly on iPhone 4 , so I have decided to upgrade it to 6.1.2 . Please help to do this.

    I have bought a iPhone 4 , yesterday . I heard that iOS 7 is not running properly on iPhone 4 , so I have decided to upgrade it to 6.1.2 . Please help to do this.

    YOU CAN'T.
    If you upgrade your phone you can only upgrade to iOS 7 and that is it.  You can only ever update to the lastest available software, which in this case is iOS 7.  You either upgrade to this or not at all because you can't upgrade to anything else.

  • Stumped with SwingWorker -- code compiles but doesn't run right

    Okay, sorry to post a ton of code, but I'm creating a swing gui that will use swing worker to create an object of the followng class, one method that sleeps and returns a random number:
    public class BigJob{
         public int doBigJob(){
              try {
              Thread.sleep(15000);
              } catch (InterruptedException e){
              e.printStackTrace();
         int number = (int)(Math.random() * 50);
         return number;
    }I can get the gui program below to run without the SwingWorker, but am having trouble getting it to run properly. The code posted below compiles and starts up ok, but when I click the "click to do big job" button, it just doesn't do anything.
    I created a runnable in the main method, and invoked the method to build the gui, so that's working.
    I have the SwingWorker defined in an inner class that implements ActionListener; I'm guessing that's the problem. I should probably put the SwingWorkder in its own inner class, and invoke it from the first listener class?
    here's the code:
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.BorderLayout;
    import javax.swing.SwingWorker;
    public class WorkerTest{
         private JFrame frame;
         private JButton button1;
         private JButton button2;
         private JButton button3;
         private JPanel topPanel;
         public static void main (String[] args){
         SwingUtilities.invokeLater(new Runnable() {
              public void run(){
              WorkerTest wtest = new WorkerTest();
              wtest.buildGui();
         } // end main
         public void buildGui(){
         frame = new JFrame("frame to test swing worker");
         frame.setSize(700,200);
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLayout(new BorderLayout());
         topPanel = new JPanel();
         frame.add(topPanel, BorderLayout.NORTH);
         button1 = new JButton("click to change text");
         button1.addActionListener(new Button1Listener());
         button2 = new JButton("click to do big thing");
         button1.addActionListener(new Button2Listener());
         button3 = new JButton("click to change text");
         button3.addActionListener(new Button3Listener());
         topPanel.add(button1);
         topPanel.add(button2);
         topPanel.add(button3);
         frame.setVisible(true);
    // inner classes to add listeners
         class Button1Listener implements ActionListener{
              public void actionPerformed(ActionEvent e){
              button1.setText("i've been clicked");
         class Button2Listener implements ActionListener{
              public void actionPerformed(ActionEvent e){
              // execute job in main thread
              //BigJob job = new BigJob();
              //button2.setText("big job is done: " + job.doBigJob());
              // execute job in its own thread:
              SwingWorker worker = new SwingWorker<BigJob, Void>(){
              BigJob job;
              int resultNum;
                   public BigJob doInBackground(){
                   job = new BigJob();
                   resultNum = job.doBigJob();
                   button2.setText("big job done: " + resultNum);
                   return job;
         class Button3Listener implements ActionListener{
              public void actionPerformed(ActionEvent e){
              button3.setText("i've been clicked also");
    } // end WorkerTestthanks,
    bp

    badperson wrote:
    where in the code should that go, in the listener class?
    SwingWorker worker = new SwingWorker<BigJob, Void>() {
        public BigJob doInBackground() {
            // code
         return job;
    worker.execute();

  • Small Applet Compiles Fine.. But won't run!

    The Applet compiles absoluetly fine.. But it won't run. Is this supposed to ever happen? Can I have some tips on why it isn't working?
    import java.applet.*;
    import java.awt.*;
    import java.lang.*;
    public class Loop1 extends Applet{
      Label LoopLabel = new Label();
      String InfoString = null;
      int r = 0;
    public void init() {
    InfoString = getParameter("info");
    r =
    Integer.parseInt(getParameter("repetitons"));
    for (int i=1; i <= r; i++) {
    InfoString = InfoString + "X";
    public void paint(Graphics g) {
    g.drawString(InfoString, 5, 10);
    }and the html (i doublt you'll need it though)
    <APPLET CODE=Loop1.class WIDTH=500 HEIGHT=500>
    <PARAM NAME=info VALUE="6">
    <PARAM NAME=repetitions VALUE="6">
    </APPLET>

    typo, it runs otherwise
    http://www.geocities.com/rmlchan/indexLoop1.html
    r = Integer.parseInt(getParameter("repetitons"));
    <PARAM NAME=repetitions VALUE="6">

  • Compiles, but won't output anything but "0"

    I'm using Xinox JCreator LE, trying to run the following code:
    import java.io.*;
    public class Tester {
         //default constructor
         public Tester() {
              //for storing my elements! yay
              Element [] myElements;
              System.out.print("test");
              //read in the file to an array
              myElements = readInElements();
              //make sure it's read in properly
              for (Element e : myElements) {
                   System.out.println(e);
         //read in elements from a comma separated values file
         private Element [] readInElements() {
              Element [] myElements = null;
              System.out.println("test");
              try {
                   //count the number of lines
                   int numLines = 0;
                   BufferedReader count = new BufferedReader(new FileReader("elements.csv"));
                   while (count.readLine() != null) numLines++;
                   count.close();
                   //resize the array
                   myElements = new Element[numLines];
                   numLines = 0;
                   //fill the array
                   BufferedReader in = new BufferedReader(new FileReader("elements.csv"));
                   //get each line, split it around commas, add a new Element to the array
                   String str;
                   while ((str = in.readLine()) != null) {
                        String [] line = str.split(",");
                        //if the file isn't correct, blow up
                        if (line.length != 8) throw new IOException("Malformed input file.");
                        //create the new element in the array
                        myElements[numLines++] = new Element(
                             Integer.parseInt(line[0]),
                             Double.parseDouble(line[1]),
                             line[2],
                             line[3],
                             Integer.parseInt(line[4]),
                             Integer.parseInt(line[5]),
                             Integer.parseInt(line[6]),
                             Double.parseDouble(line[7])
                   in.close();
              } catch (IOException e) {
                   System.out.print(e);
                   System.exit(1);
              return myElements;
         //hello I am a main method how are you today
         public static void main(String [] args) {
              System.out.print("test");
              new Tester();
    }It compiles fine, but when I run it I get this as output:
    --------------------Configuration: Assignment 3 - JDK version 1.6.0_02 <Default> - <Default>--------------------
    0
    Process completed.I'm hoping I'm just missing something very simple because this is quite annoying.

    It worked from the command line; there was an extra class in the folder called "Test" which the IDE defaulted to for some reason. Thanks, I knew it was something stupid :)

  • My ipod touch says it is connected to wifi, but won't run anything that uses it like safari or itunes, and I don't know how to fix it

    Can anyone help me? my  ipod touch says it is connected to wifi, but it won't run anything that uses wifi like safari or itunes, and I don't know how to fix it

    You didn't indicate if it ever worked.  If it NEVER did, the problem could be caused by a firewall in the router.  For reasons that I do not understand, that will affect IOS (iPod/iPad) communication but will not affect computers or other devices.
    You will need administrative access to the router.  If a firewall is present, turn it off and test the iPod again.  If it works, turn the firewall back on but weaken it a notch and test the iPod again.  Repeat as required.

Maybe you are looking for

  • Free goods determination from material determination.

    Hi experts, I have one issue for you, My scenario is: we issue freee goods 1:1. i configured free goods setting and maintained VBN1 (condition records for free goods). i even maintained material determination configuration settings and maintained VB1

  • I just got a new ipad 2 but I having trouble setting it up, can someone help me. thank yoy

    I just got a new ipad 2 but I'm having trouble setting it up, can someone help me?

  • Desktop background

    Hi guys I have macbook pro 15", early 2011, 10.8.4 mountain lion OSx. I noticed while choosing and photo as wallpaper in the desktop, that it will be return to the default image sets with the OSx after shutdown the laptop. I chooses many images (phot

  • TIME IN SAP

    Hi all, I would be thankful if someone helps me out regarding this issue. Iam testing the SAP messages in the tc sxmb_moni. I need to caluculate the proper time difference between the messages where i found that the time on my desktop and the message

  • Upgrading to snow leopard  10.6.3 from tiger 10.4.11

    I just bought the snow leopard upgrade, and went to put the installations cd into my computer and and about 15 seconds later it spits it out. I don't know if I have to do something to prepare my Macbook pro for the upgrade or not. The apple rep from