Help in running javah

Hi
I am a newbee to java and jni
I have following code
package com.vishal.practice;
import java.io.PrintWriter;
public class NativeDemo
    int i;
    public static void main(String[] args)
        NativeDemo ob = new NativeDemo();
        ob.i = 10;
        PrintWriter pw = new PrintWriter(System.out);
        pw.write("Before: " + ob.i);
        ob.test();
        pw.write("After: " + ob.i);
    public native void test();
    static
        System.loadLibrary("NativeDemo");
}I have compiled the code to build .class file
when I try to execute the following command
javah -jni com.vishal.practice NativeDemo
I get the following error
Error: Class com.vishal.practice.NativeDemo could not be found.
Not Sure what the reason is.
Please Help
Regards
Vishal

I set my classpath to the absolute path of class
file.
Regards
VishalHi Vishal,
I'm also getting the similar error.
While, I'm compiling everything is Okay,,,
But, when I tried to run, I'm getting those errors..
Exception in thread "main" java.lang.UnsatisfiedLinkError: no NativeDemo in java
.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at NativeDemo.<clinit>(NativeDemo.java:11)
Can you please explain me what have you done to resolve the issue..
(I'll be happy if you elaborate you answer..since, I'm new to JNI)
Waiting for your reply...
Amar.

Similar Messages

  • I need help to run this package and i got some error

    create or replace
    PACKAGE BODY SUBS_INS_API_sun
    AS
    PROCEDURE SUBSCRIBER_INS_sun
        (SOURCE_SYS_ID IN VARCHAR2,
        TRACKING_ID IN VARCHAR2,
        ACCOUNT_NO IN VARCHAR2,
        prepaidActDevDetails_tab IN prepaidactdvcdetailsobj_sun,
        ERROR_CODE OUT VARCHAR2)
    IS
    Input_Parameter_Is_Null EXCEPTION;
    pragma exception_init(Input_Parameter_Is_Null,-2000);
    prepaidAccountDetails prepaidActDevDetails_tab:= prepaidActDevDetails_tab(NULL,NULL,NULL,NULL,NULL);
    STATUS VARCHAR2(1):='1';
    cust_no VARCHAR(10);
    m_mac_id VARCHAR2(20);
      subscriber_master_Rec subscriber_master%ROWTYPE                 :=NULL;
      flg NUMBER(1);
    BEGIN
       IF(Source_Sys_Id IS NULL OR Tracking_Id IS NULL OR ACCOUNT_NO IS NULL OR prepaidAccountDetails.LAST=0) THEN
        RAISE Input_Parameter_Is_Null;
      END IF;
      BEGIN
             select cm_cust_no into cust_no from customer_master where cm_cust_id=ACCOUNT_NO and cm_status in('A','P','0');
          EXCEPTION
          WHEN NO_DATA_FOUND THEN
            DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                   STATUS:='0';
        END;
      BEGIN
         FOR i IN prepaidAccountDetails.FIRST .. (prepaidAccountDetails.LAST) LOOP
         prepaidAccountDetails1:=prepaidActDevDetails_tab(i);
         prepaidAccountDetails1.Status_of_device:='1';
         IF (prepaidAccountDetails.Account_id is NULL OR prepaidAccountDetails.Mac_Id is NULL or prepaidAccountDetails.LOB_value is NULL) THEN
          RAISE Input_Parameter_Is_Null;
                END IF;
                IF(prepaidAccountDetails.LOB_value = 'VDO') THEN
                 IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
                  Error_code :='SI002';
                 DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                 STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 END IF;
                END IF;
                begin
                   select 1 into flg from subscriber_master where pm_phone_no=prepaidAccountDetails.Mac_Id and pm_status in('P','0','A','B');
                EXCEPTION
                 WHEN NO_DATA_FOUND THEN
                  flg:=0;
                 END;
                 if(flg=1) then
                  DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                  STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 END IF;
                 begin
                  select md_mac_id into m_mac_id from mac_details where md_mac_id=prepaidAccountDetails.Mac_Id and md_start_date<=sysdate
                  and md_status='A';
                EXCEPTION when OTHERS then
                  Error_code :='SI004';
                 DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                  STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 end;
              if(STATUS= 1 and prepaidAccountDetails.Status_of_device='1') then
               SELECT PM_SUBS_ACT_NO_SEQ.nextval
               INTO subscriber_master_rec.PM_SUBS_ACT_NO
               FROM dual;
              subscriber_master_Rec.pm_phone_no          :=prepaidAccountDetails.Mac_Id;
            subscriber_master_Rec.pm_open_date         :=sysdate;
              subscriber_master_rec.pm_status            :='P';
              subscriber_master_rec.PM_CUST_LVL_YN:='S';
             subscriber_master_rec.PM_EQUP_CODE:=prepaidAccountDetails.LOB_value;
             subscriber_master_rec.PM_HOME_AREA:='HOM';
             subscriber_master_rec.PM_USG_CODE:='USG';
             subscriber_master_rec.PM_NO_TYPE:='S';
             subscriber_master_rec.PM_TCG_CODE:='DEF';
             subscriber_master_rec.PM_APLN_DATE:=sysdate;
              subscriber_master_rec.PM_USER2:=prepaidAccountDetails.LOB_value;
              subscriber_master_rec.PM_USER3:=prepaidAccountDetails.Channel_Line_Up;
              subscriber_master_rec.pm_cust_no:=cust_no;
              INSERT INTO subscriber_master VALUES subscriber_master_rec;
            END IF;
         END LOOP;
        END;
      END SUBSCRIBER_INS_sun;
    END SUBS_INS_API_sun;
    and
    i got this error
    Package Body PREPAID_TESTNEW.SUBS_INS_API@PREPAID_TESTNEW
    Error(73,4): PL/SQL: Statement ignored
    Error(73,99): PLS-00302: component 'LAST' must be declared
    Error(87,6): PL/SQL: Statement ignored
    Error(87,37): PLS-00302: component 'FIRST' must be declared
    please help to run this package if anyone knows

    now i corrected my package. It working fine. But, how to run this package via procedure. my procedure check below. I give all the details about my package check below.
    ---pkg specification
    create or replace
    PACKAGE SUBS_INS_API_SS
    IS
    PROCEDURE SUBSCRIBER_INS_SS
        (SOURCE_SYS_ID IN VARCHAR2,
        TRACKING_ID   IN VARCHAR2,
        ACCOUNT_NO IN VARCHAR2,
        prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
        ERROR_CODE OUT VARCHAR2);
    END SUBS_INS_API_SS;
    -----pkg body
    create or replace
    PACKAGE BODY SUBS_INS_API_SS
    AS
       PROCEDURE log_error (ip_code          IN VARCHAR2,
                            ip_message       IN VARCHAR2,
                            ip_description   IN VARCHAR2)
       IS
       BEGIN
          INSERT INTO ERR_LOG (IEL_REF_ID,
                               IEL_DATE,
                               IEL_CODE,
                               IEL_MSG,
                               IEL_DESC)
               VALUES (IVRS_ERR_LOG_SEQ.NEXTVAL,
                       SYSDATE,
                       ip_code,
                       ip_message,
                       ip_description);
       EXCEPTION
          WHEN OTHERS
          THEN
             ROLLBACK;
       END log_error;
       PROCEDURE INSERT_WS_LOG (SOURCE_SYS_ID   IN VARCHAR2,
                                STATUS          IN VARCHAR2,
                                TRACKING_ID     IN VARCHAR2,
                                ACCOUNT_ID      IN VARCHAR2,
                                MAC_ID          IN VARCHAR2)
       IS
          ws_log_rec   WS_LOG%ROWTYPE := NULL;
       BEGIN
          SELECT WS_LOG#REC#ID.NEXTVAL INTO ws_log_rec.rec#id FROM DUAL;
          ws_log_rec.VER#ID := 1;
          ws_log_rec.CRE#TS := SYSDATE;
          ws_log_rec.wl_source := SOURCE_SYS_ID;
          ws_log_rec.wl_status := Status;
          ws_log_rec.wl_tracking_id := tracking_id;
          ws_log_rec.wl_account_id := account_id;
          ws_log_rec.wl_mac_id := mac_id;
          INSERT INTO ws_log
               VALUES ws_log_rec;
       EXCEPTION
          WHEN OTHERS
          THEN
             ROLLBACK;
       END INSERT_WS_LOG;
        PROCEDURE REPLICO_DEV_INFO( Acc_id IN VARCHAR2, Mc_Id IN VARCHAR2,channel IN VARCHAR2,
                                     LOB_VAL IN VARCHAR2, outlet1 IN VARCHAR2, kit_cod IN VARCHAR2,
                                     serial_No IN VARCHAR2, shipperr IN VARCHAR2, estm_recived_date IN date)                                                                
        IS
                  Replico_device_info_det_Rec   Replico_device_info_det%ROWTYPE := NULL;
                  REC_ID  NUMBER;
        BEGIN
                  SELECT REPLICO_DEVICE_INFO_DET#RECID.nextval INTO REC_ID FROM dual; 
                   Replico_device_info_det_Rec.REC#ID := REC_ID;                 
                   Replico_device_info_det_Rec.ACCOUNT_ID := Acc_id;
                   Replico_device_info_det_Rec.MAC_ID := Mc_Id;               
                   Replico_device_info_det_Rec.CHANNEL_LINE_UP := channel;
                   Replico_device_info_det_Rec.LOB_VALUE := LOB_VAL;  
                   Replico_device_info_det_Rec.OUTLET := outlet1;
                   Replico_device_info_det_Rec.KIT_CODE := kit_cod;                
                   Replico_device_info_det_Rec.SERIAL_NUMBER := serial_No;                
                   Replico_device_info_det_Rec.SHIPPER := shipperr;                
                   Replico_device_info_det_Rec.ESTIMATED_RECIVED_DATE := estm_recived_date;
                  INSERT INTO replico_device_info_det
                        VALUES Replico_device_info_det_Rec;
                  EXCEPTION
                          WHEN OTHERS
                          THEN
                              ROLLBACK;
        END REPLICO_DEV_INFO;
       PROCEDURE SUBSCRIBER_INS_SS (
          SOURCE_SYS_ID              IN     VARCHAR2,
          TRACKING_ID                IN     VARCHAR2,
          ACCOUNT_NO                 IN     VARCHAR2,
          prepaidActDevDetails_tab   IN     prepaidActDeviceDetails_tabobj,
          ERROR_CODE                    OUT VARCHAR2)
       IS
          Input_Parameter_Is_Null       EXCEPTION;
          PRAGMA EXCEPTION_INIT (Input_Parameter_Is_Null, -2000);
          prepaidAccountDetails         prepaid_act_dvc_details_obj
                                           := prepaid_act_dvc_details_obj  (NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL);
          STATUS                        VARCHAR2 (1) := '1';
          cust_no                       VARCHAR (10);
          m_mac_id                      VARCHAR2 (20);
          channel_lineup                VARCHAR2 (25);
          LOB_VALUE                     VARCHAR2 (25);
          subscriber_master_Rec         subscriber_master%ROWTYPE := NULL;
        Replico_device_info_det_Rec   Replico_device_info_det%ROWTYPE := NULL;
          flg                           NUMBER (1);
          plan_code                     VARCHAR2(10);
          subs_aact_no                 NUMBER(20);
          m_plan_code1               payment_transaction_history.TH_PLAN_CODE%type;
          m_payment_mode1           payment_transaction_history.TH_PAYMENT_MODE%type;
          pm_phone_no_cur        subscriber_master.pm_phone_no%type;
          pm_status_cur          subscriber_master.pm_status%type;
          pm_user2_cur          subscriber_master.pm_user2%type;
          pm_user9_cur        subscriber_master.pm_user9%type;
          pm_cust_no_cur       subscriber_master.pm_cust_no%type;
          pm_cust_1            subscriber_master.pm_cust_no%type;
          cm_i                 customer_master.cm_status%type;
         CURSOR subs_rec is select pm_cust_no, pm_phone_no, pm_status, pm_user2, pm_user9 from subscriber_master
         where pm_cust_no = cust_no and pm_status= 'S';
       BEGIN
          IF (   Source_Sys_Id IS NULL
              OR Tracking_Id IS NULL
              OR ACCOUNT_NO IS NULL
              OR prepaidActDevDetails_tab.LAST = 0)
          THEN
             RAISE Input_Parameter_Is_Null;
          END IF;
          BEGIN
             SELECT cm_cust_no
               INTO cust_no
               FROM customer_master
              WHERE cm_cust_id = ACCOUNT_NO AND cm_status IN ('A', 'P', '0');
          EXCEPTION
             WHEN NO_DATA_FOUND
             THEN
                ERROR_CODE := 'SI001';
                log_error ('SI001',
                           SQLERRM,
                           'No Customer exist with Active or Pre Actiavted');
                INSERT_WS_LOG (Source_Sys_Id,
                               'F',
                               Tracking_Id,
                               Account_No,
                               prepaidAccountDetails.Mac_Id);
                STATUS := '0';
          END;
          BEGIN
             FOR i IN prepaidActDevDetails_tab.FIRST ..
                      (prepaidActDevDetails_tab.LAST)
             LOOP
                prepaidAccountDetails := prepaidActDevDetails_tab (i);
                prepaidAccountDetails.Status_of_device := '1';
                IF (   prepaidAccountDetails.Account_id IS NULL
                    OR prepaidAccountDetails.Mac_Id IS NULL
                    OR prepaidAccountDetails.LOB_value IS NULL)
                THEN
                   RAISE Input_Parameter_Is_Null;
                END IF;
                IF (prepaidAccountDetails.LOB_value = 'VIDEO')
                THEN
                   /* Commented as channel lineup is not coming from the input request */
                   /*IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
                    Error_code :='SI002';
                   log_error ('SI002', SQLERRM, 'Channel line up is mandatory for Video');
                   INSERT_WS_LOG(Source_Sys_Id,'F',Tracking_Id,Account_No,prepaidAccountDetails.Mac_Id);
                   STATUS:=0;
                    prepaidAccountDetails.Status_of_device:='0';
                   END IF;*/
                   SELECT EC_CHANNEL_LINEUP
                     INTO channel_lineup
                     FROM ELIGIBLE_CUSTOMER
                    WHERE EC_CUSTOMER_NO = cust_no;
                END IF;
                BEGIN
                   SELECT 1
                     INTO flg
                     FROM subscriber_master
                    WHERE     pm_phone_no = prepaidAccountDetails.Mac_Id
                          AND pm_status IN ('P', '0', 'A', 'B');
                EXCEPTION
                   WHEN NO_DATA_FOUND
                   THEN
                      flg := 0;
                END;
                IF (flg = 1)
                THEN
                   ERROR_CODE := 'SI003';
                   log_error ('SI003',
                              SQLERRM,
                              'Customer Already Exist with given Mac Id');
                   INSERT_WS_LOG (Source_Sys_Id,
                                  'F',
                                  Tracking_Id,
                                  Account_No,
                                  prepaidAccountDetails.Mac_Id);
                   STATUS := 0;
                   prepaidAccountDetails.Status_of_device := '0';
                END IF;
                BEGIN
                   SELECT md_mac_id
                     INTO m_mac_id
                     FROM mac_details
                    WHERE     md_mac_id = prepaidAccountDetails.Mac_Id
                          AND md_start_date <= SYSDATE
                          AND md_status = 'A';
                EXCEPTION
                   WHEN OTHERS
                   THEN
                      ERROR_CODE := 'SI004';
                      log_error ('SI004', SQLERRM, 'Invalid Mac Id');
                      INSERT_WS_LOG (Source_Sys_Id,
                                     'F',
                                     Tracking_Id,
                                     Account_No,
                                     prepaidAccountDetails.Mac_Id);
                      STATUS := 0;
                      prepaidAccountDetails.Status_of_device := '0';
                END;
                 select pm_cust_no into pm_cust_1 from subscriber_master where pm_cust_no = cust_no;
                IF (STATUS = 1 AND prepaidAccountDetails.Status_of_device = '1')
                THEN
                     SELECT DECODE (prepaidAccountDetails.LOB_value,
                                  'HSD', 'HSD',
                                  'VIDEO', 'VDO')
                     INTO LOB_VALUE
                     FROM DUAL;
            OPEN subs_rec;
            LOOP
            FETCH subs_rec into pm_cust_no_cur, pm_phone_no_cur, pm_status_cur, pm_user2_cur, pm_user9_cur;
              IF subs_rec%FOUND THEN
                 IF
                  ( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = prepaidAccountDetails.outlet and pm_status_cur = 'S')
                    THEN
                        update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id
                        where pm_cust_no = pm_cust_no_cur and pm_user9 = prepaidAccountDetails.outlet;
                         select cm_status into cm_i from customer_master where cm_cust_no = pm_cust_no_cur;
                            IF( cm_i = '0')
                            THEN
                                update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
                             END IF;
                             REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                               prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                               prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
                    ELSIF
                        ( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = null and pm_status_cur = 'S')
                          THEN
                             update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id, pm_user9 = prepaidAccountDetails.outlet
                             where pm_cust_no = pm_cust_no_cur and pm_user9 = NULL;
                             update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
                             REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                               prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                               prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
                    END IF;
                 ELSIF subs_rec%NOTFOUND THEN
                       SELECT PM_SUBS_ACT_NO_SEQ.NEXTVAL
                       INTO subs_aact_no
                       FROM DUAL;
                       subscriber_master_rec.PM_SUBS_ACT_NO := subs_aact_no;
                       subscriber_master_Rec.pm_phone_no :=
                        prepaidAccountDetails.Mac_Id;
                       subscriber_master_Rec.pm_open_date := SYSDATE;
                       subscriber_master_rec.pm_status := 'P';
                       subscriber_master_rec.PM_CUST_LVL_YN := 'S';
                       subscriber_master_rec.PM_EQUP_CODE := LOB_VALUE;
                       subscriber_master_rec.PM_HOME_AREA := 'HOM';
                       subscriber_master_rec.PM_USG_CODE := 'USG';
                       subscriber_master_rec.PM_NO_TYPE := 'S';
                       subscriber_master_rec.PM_TCG_CODE := 'DEF';
                       subscriber_master_rec.PM_APLN_DATE := SYSDATE;
                       subscriber_master_Rec.PM_NAME := prepaidAccountDetails.Mac_Id;
                       subscriber_master_Rec.PM_STAFF_id := '16';
                       subscriber_master_rec.PM_USER2 := LOB_VALUE;
                       subscriber_master_rec.PM_USER3 := channel_lineup;
                       subscriber_master_rec.pm_cust_no := cust_no;
                       subscriber_master_rec.PM_USER8 := 'Y';
                       INSERT INTO subscriber_master
                       VALUES subscriber_master_rec;
                       REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                         prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                         prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
             END IF;
             END LOOP;
             CLOSE subs_rec;
                  SELECT TH_PLAN_CODE,TH_PAYMENT_MODE
                   INTO m_plan_code1,m_payment_mode1
                   FROM PAYMENT_TRANSACTION_HISTORY
                   WHERE TH_CUSTOMER_NO = cust_no
                   AND TH_LOB = LOB_VALUE
                   AND TH_SUBSCRIBER_NO IS NULL;
                   IF(LOB_VALUE = 'HSD') THEN
                    IF(m_plan_code1 = 'SIKI') THEN
                          plan_code := 'SIKI';
                                             ELSE
                      plan_code := 'KIT';
                    END IF;
                   ELSE
                    IF(m_plan_code1 = 'SIKT') THEN
                             plan_code := 'SIKT';
                    ELSE
                          plan_code := 'TV';
                    END IF;
                   END IF;               
                          UPDATE PAYMENT_TRANSACTION_HISTORY SET TH_SUBSCRIBER_NO = subs_aact_no, th_writeback_status = 'Y' WHERE TH_CUSTOMER_NO = cust_no AND TH_PLAN_CODE = plan_code;
                          COMMIT;
                END IF;
             END LOOP;
          END;
       END SUBSCRIBER_INS_SS;
    END SUBS_INS_API_SS;
    --- type object
    create or replace
    TYPE   prepaid_act_dvc_details_obj--prepaidAccountDeviceDetailsObj
    AS     OBJECT ( Account_id VARCHAR2 ( 25 )
           , Mac_Id VARCHAR2 ( 25 )
           , Channel_Line_Up VARCHAR2 ( 25 )
           , LOB_value VARCHAR2 ( 25 )
           , Status_of_device VARCHAR2 ( 25 )
            , outlet VARCHAR2(25)
            , kit_code VARCHAR2(25)
            , serial_Number VARCHAR2(25)
            , shipper VARCHAR2(25)
            , estimated_recived_date date )
    type---
    create or replace
    TYPE prepaidActDeviceDetails_tabobj as table of prepaid_act_dvc_details_obj
    ---- i need to run this package via separate procedure. but i don't know how to pass the variable. because the passing argument contain object tab variable. please help me.. give me suggestion or procedure to run this pkg.

  • I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro.... The operation can't be completed because an unexpected error occurred (error code -50)

    I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro....
    The operation can’t be completed because an unexpected error occurred (error code -50)

    I would get an external drive today and copy all your stuff off the TC.. forget trying to load more onto it. There is a good chance after 3years (A 2TB should be only about 2years tops), the disk or the TC itself is on the way out. Do it immediately. If TM is also failing to backup you need to recognise symtoms of impending doom.
    Unfortunately the error messages are archane and it is hard to discover their meaning.
    You also cannot verify a network drive.. you can verify the TM sparsebundle though so do that.
    A5. http://pondini.org/TM/Troubleshooting.html
    Reboot the whole network from off.. certainly if you run later OS it can simply lose the drive..
    If you still fail to be able to copy to the TC.. then get that external and copy off it. Tell us if you can do that.

  • Help with running multiple threads

    I'm new to programming with threads. I want to know how to run
    multiple threads at the same time. Particularly for making games
    in Java which I'm also begining to learn. For running multiple
    threads at the same time, do you have to put two run() methods
    in the source? If not then how do you make two threads or more
    run at the same time?
    Thanks for helping.

    For running multiple
    threads at the same time, do you have to put two run()
    methods
    in the source? Hi there,
    Each thread is presumably performing a task. You may be performing the same task multiple times or be performing different tasks at once. Either way, each task would typically be contained within the run() method of a class. This class would either be a subclass of java.lang.Thread (extends Thread) or would be an implementation of java.lang.Runnable (implements Runnable). In either case, you would define a method with signature (public void run()...). The difference comes into play when you wish to actually perform one of these tasks. With a subclass of Thread, you would simply perform:
    new MyTask().start();
    With an implementation of Runnable, you would do this:
    new Thread(new MyTask()).start();
    This assumes you don't need to monitor the threads, won't be sending any messages to your tasks or any such thing. If that were the case, you would need to tuck away those returns to new MyTask() for later access.
    In order to launch two threads simultaneously, you would have something along the lines of:
    new MyTask().start();
    new MyOtherTask().start();
    Now it is perfectly possible that MyTask() would complete before MyOtherTask() managed to start in which case it wouldn't appear as if you had actually had multiple threads running, but for non-trivial tasks, the two will likely overlap. And of course, in a game, these tasks would likely be launched in response to user input, which means that you wouldn't have any control over when or in what order they executed.
    Anyhow, it's as simple as that. You should also consider following the Java Threading trail which shows a simple example of using multiple threads. You can find it at:
    http://java.sun.com/docs/books/tutorial/essential/threads/index.html
    Regards,
    Lynn

  • TS1363 I tried to print off some of the iTunes advice but my computer froze. I re-booted the computer and ran the diagnostic test again but now "Secure link to itunes store failed"  AND " itunes helper not running."

    I just tried to print off some itunes advice but my computer froze.  I re-booted it and ran the ipod diagnostic test again to get back to the screen I was on. This time "Secure Link to  i tunes store failed" AND "i tunes helper not running" both appeared.   Please help, all I can see is "Appears in Windows but not iTunes" at the top of the screen.  Even though I only vaguely know what that means, I don't think that's the help I need.    

    I just tried to print off some itunes advice but my computer froze.  I re-booted it and ran the ipod diagnostic test again to get back to the screen I was on. This time "Secure Link to  i tunes store failed" AND "i tunes helper not running" both appeared.   Please help, all I can see is "Appears in Windows but not iTunes" at the top of the screen.  Even though I only vaguely know what that means, I don't think that's the help I need.    

  • HELP   Cannot run FLASH PLAYER on my LAPTOP Windows XP

    Sept 8 2011     I hv been trying to run Adobe Flash Player  v 10.1.3 on my laptop HP/Compac Presario V2410
    for weeks now.  I download program but it doesnt show up that it is on my computer. 
    I hv been trying every solution that ADOBE offers and I hv chked all over the internet.  I hv tried every browser  I.E.8,   Google Chrome, Monzilla FoxFire,
    and nothing works.   I must get a solution b/c I working on developing my WEBPAGE that uses ADOBE FLASH.
    Adobe FLASH PLAYER works on my 2 desktops...  well atleast in Monzilla FoxFire & Google Chrome, sometimes works in I.E. 8.
    On all my computers  FLASH doesnt showup in my CONTROL PANEL in the Add/REMOVE Program section.
    The name Adobe Flash shows up, but the megabyte amount doesnt.   So this leads me to believe that the program downloads, but never really
    uploads to my computer.  IT works only b/c it is already in GOOGLE Chrome  &  Monzilla FoxFire.  BUT... I cannot get it going on my laptop which is running
    Windows XP  32 bits  SP3   AMD Turion 64   Proceesor    2GB RAM   Hard DRive  80GB -  57  GB free    CA  ANTIVIRUS.  I do disable my antivirus
    when I download the FLASH program.
    I just CANNOT BELIEVE that ADOBE puts out this program, and cannot get a SOLUTION to all of OUR PROBLEMS.
    I see that THIS IS effecting  100's & 1000's of us.  EVERYONE uses FLASH.   PLS ADOBE HELP ME & US OUT !!!.
    PLS ADVISE
    ozoneddddd

    Chris
    Chrome doesnt work with my LapTop.
    C:\windows\system32\macromed\flash
    These are the files in the above mentioned folder:
    Flash10w.ocx               Flashinstall             flashplayer.xpt           FlashUtil10w_ActiveX
    ActiveX Control             Text Document        XPT File                    Adobe Flash Player Instal...
    6235 KB                       38 KB                     1 KB                        Adobe Systems, Inc.
    FlashUtil10w_ActiveX.dll                           FlashUtil10w_Pligin                        NPSWF32.dll
    10.3.183.7                                               Adobe Flash Player Install...           10.3.183.7
    Adobe Flash Player Helper 10...                Adobe Systems, Inc,                      Shockwave Flash 10.3 r 183
    Pls Advise
    Ritchard

  • HELP! Run-time Error with this code.

    I'm having problem with the code below. But if I were to remove the writer class and instances of it (writeman), then there are no problems. Can some1 pls tell me why the writer class is giving problems. Btw, no compilation errors, only errors at run-time..........
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.MouseListener;
    import java.awt.event.*;
    public class HelloWorld extends Applet
    public static String MyString = new String("Hello");
    Graphics f;
    public void init()
    Changer Changer1 = new Changer();
    writer writeman = new writer();
    setBackground(Color.red);
    setForeground(Color.green);
    addMouseListener(Changer1);
    writeman.paintit(f);
    public void paint(Graphics g)
    g.drawString(MyString,10 ,10);
    public class Changer implements MouseListener
    public void mouseEntered(MouseEvent e)
    setBackground(Color.blue);
    MyString = "HI";
    paint(f);
    repaint();
    public void mouseExited(MouseEvent e)
    setBackground(Color.red);
    repaint();
    public void mousePressed(MouseEvent e){};
    public void mouseReleased(MouseEvent e){};
    public void mouseClicked(MouseEvent e){};
    public class writer
    public void paintit(Graphics brush)
    brush.drawString("can u see me", 20, 20);

    I assume the exception you are getting is a NullPointerException...
    When you applet is loaded, it is initialised with a call to init... the following will then occur...
    HelloWorld.init()
    writeman.paintit(f)
    // f has not been initialised, so is null
    brush.drawString("can u see me", 20, 20)
    // brush == f == null, accessing a null object causes a NullPointerException!
    The simplest way to rectify this is to not maintain your own reference to the Graphics object. Move the writer.paintit(f) method to the HelloWorld.paint(g) method, and pass in the given Graphics object. Also, change the paint(f) call in Changer to repaint(), which will cause the paint method to be called with a valid Graphics object - which will then be passed correctly to writer.
    Hope this helps,
    -Troy

  • Need help with running a Java program on Linux

    I am trying to get a Java program to run on a Linux machine. The program is actually meant for a Mac computer. I want to see if someone with Java experience can help me determine what is causing the program to stall. I was successful in getting it installed on my Linux machine and to partially run.
    The program is an interface to a database. I get the login screen to appear, but then once I enter my information and hit enter the rest of the program never shows, however, it does appear to connect in the background.
    Here is the error when I launch the .jar file from the command screen:
    Exception in thread "main" java.lang.IllegalArgumentException: illegal component position
    at java.awt.Container.addImpl(Unknown Source)
    at java.awt.Container.add(Unknown Source)
    I am not a programmer and I am hoping this will make some sense to someone. Any help in resolving this is greatly appreciated!

    Well, without knowing a little bit about programming, and how to run your debugger, I don't think you're going to fix it. The IllegalArgumentException is saying that some call does not like what it's getting. So you'll have to go in an refactor at least that part of the code.

  • Help required - running a Java program from the command line

    Hi,
    I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
    When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
    Both the application jar file and the external jar file are in my root directory (C:\).
    My command line call is as follows:
    java -cp c:MyExternalLib.jar -jar MyApp.jar
    Any help greatly appreciated.
    Thanks,
    Walter

    hi,
    set classpath=%classpath%;c:\myjar.jar;
    here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
    java mypgm
    this will solve ur problem
    regards,
    Ganesh

  • Need help on running a book in HTML preview fetching entity from member lst

    Hi Everyone,
    I need a help on this quickly.
    I am trying to run a book in which I include 1 report and this report has 3 POVs:
    1) Year--> depends on book point of view
    2) Period --> depends on book point of view
    3) Entity--> This I am trying to pull from the dynamic member list or static member list.
    Now when I am running a book in HTML Preview, I am getting the error "5104: Error executing Book member selection Catastrophic failure".
    When I try to run the static member list for Entity (I include random 5 entities), the book run but gives me 5 different reports with fix POV for year and period but the 5 reports belongs to each of the 5 entities that I include in a member list.
    My concern is how can I see the merger of all these 5 entities in 1 report on running a book in HTML preview? I know I can see the merger in PDF but how can I see that in HTML?
    Also the error which I mentioned above for dynamic POV, how can I fix that and run the entity POV using dynamic member list.
    The data is coming in this report through HFM (Hyperion Financial Management )source.
    Please suggest on this issue as it is very critical and the production is getting affected.
    Thanks,
    Sumit

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Arvind Balaraman():
    Hi
    open your form in the form builder. select file compile all and run yor form. see if it works.
    HTH
    Arvind Balaraman<HR></BLOCKQUOTE>
    Thank You.
    I allready did that and it doesn't work!!!
    null

  • Help with running OS X 10.5 with a GMA X3100 video card

    I am trying to boot Mac OS X 10.5 on my iPod. I kept booting, and every time it came up with a kernel panic. I ran it in Verbose mode, and it said that the video card was not supported. The updaters said that my iPod didn't meet the requirements, which I think that Leopard needs to be succsessfully booted to be able to update. I need help booting into Leopard so I can do some things.
    Jack

    BGreg wrote:
    Mac OS X 10.5 can't run on an iPod. A MacBook, yes, an iPod no.
    I have been able to run Cheetah and Tiger on it. Also, the partition is Mac OS Extended (Jounaled) and the disk has the GUID Partition Table. The iPod is a 2nd gen "Touch Wheel" iPod, 20 GB. The HD on my MacBook is just about full, so what other way can I use Leopard without using an external drive?

  • Need help on running methos in Forms 6i

    When I was trying to run a methods from Forms 6i Iget this message
    PDE_PSD001 Could not resolve reference to <unknown program unit> while loading block
    PO_05_aug
    In SQL I run the following code:
    CREATE OR REPLACE TYPE T_PERSONA AS OBJECT
    (NOMBRES CHAR (20),
    APELLIDOS CHAR (20),
    FECHANACIMIENTO DATE,
    MEMBER FUNCTION NOMBRECOMPLETO
    RETURN VARCHAR2,
    MEMBER FUNCTION EDAD
    RETURN VARCHAR2);
    REM
    CREATE OR REPLACE TYPE BODY T_PERSONA IS
    MEMBER FUNCTION NOMBRECOMPLETO
    RETURN VARCHAR2
    IS
    BEGIN
    RETURN RTRIM (NOMBRES) | | ' ' | | RTRIM (APELLIDOS);
    END;
    MEMBER FUNCTION EDAD
    RETURN VARCHAR2
    IS
    DD DATE;
    DIAS INTEGER;
    MESES INTEGER;
    ANIOS INTEGER;
    BEGIN
    SELECT SYSDATE INTO DD FROM DUAL;
    DIAS := DD - FECHANACIMIENTO;
    ANIOS := TRUNC (DIAS / 365);
    MESES := TRUNC ((DIAS - (ANIOS * 365)) / 30);
    DIAS := DIAS - ANIOS * 365 - MESES * 30;
    RETURN ANIOS | | ' ANIOS, ' | | MESES | | ' MESES, ' | | DIAS | | ' DIAS';
    END;
    END;
    REM
    CREATE TABLE EMPLEADO
    (DATOS T_PERSONA,
    SUELDO NUMBER);
    REM
    CREATE TABLE PROFESOR
    (DATOS T_PERSONA,
    SUELDO NUMBER,
    HORASEXTRAS NUMBER);
    INSERT INTO PROFESOR VALUES
    (T_PERSONA ('FRANCISCO', 'VILLAVICENCIO','27-12-1951'),
    1000, 400);
    In Forms, when compiling in a buttom trigger the code:
    declare
    edades varchar2(20);
    begin
    SELECT A.DATOS.NOMBRECOMPLETO () into edades
    FROM PROFESOR A;
    message (edades);
    end;
    I get the message
    PDE_PSD001 Could not resolve reference to <unknown program unit> while loading block
    PO_05_aug.
    In SQL it runs OK:
    SQL> SELECT A.DATOS.NOMBRECOMPLETO () FROM PROFESOR A;
    A.DATOS.NOMBRECOMPLETO()
    FRANCISCO VILLAVICENCIO
    Does any one help me?
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Arvind Balaraman():
    Hi
    open your form in the form builder. select file compile all and run yor form. see if it works.
    HTH
    Arvind Balaraman<HR></BLOCKQUOTE>
    Thank You.
    I allready did that and it doesn't work!!!
    null

  • Help: Default Run Target??

    Using 11g now, and Default Run Target seems to be gone! or I just can't find it... its launching using 127.0.0.1 but i need to to use a different ip address because I have code to restrict a specific ip address in the request just for added security. Can someone point me the right direction? It used to be in Tools > Project Properties... > Run/Debug/Profile > Edit (Default)
    Thanks

    The default run target is now configured in JDev 11g via ViewController -> Project Properties -> Run/Debug/Profile -> Default -> Edit ....
    Where on the Launch Settings - Default Run Target field you enter your default unbounded Task Flow:
    ie: C:\JDevSandpit\Application4\ViewController\public_html\WEB-INF\adfc-config.xml
    Then same dialog on the ADF Task Flow node, the Task Flow poplist should say (Unbounded Task Flow) and the View Activity drop down you select the page you're interested in.
    In fact the first time you run the app from your adfc-config.xml unbounded task flow by selecting the diagram and run (without selecting a web page), it should ask and set this up for you anyhow.
    I don't think this solves your problem however. Instead under the Application Navigator window see that there is an entry for IntegratedWLSConnection. Displaying it's properties reveals the server runs at 127.0.0.1. See if changing that value makes a difference when running (it does for me).
    Hope this helps and good luck.
    CM.

  • Definitely need a Gurus help - PC running Apple 30 Inch

    I recently purchased a 30 inch Apple HD Display to go with my Athlon64 3400 2.41 GHZ with 2 Gigs Ram, describing this monitor is like trying to describe the Grand Canyon, this monitor is excellent! However I have run into a issue where I cannot get the side monitor control panel to function, IE Power, Brightness and Contrast. Im using an
    NVIDIA GeForce 7600 GS
    http://www.nvidia.com/page/geforce_7600.html
    and also have a
    NVIDIA Geforce 7900 GT
    http://www.nvidia.com/page/geforce_7900.html
    Ive tried installing/unistalling the drivers over and over again, I am a fairly competent person on a computer and have pretty much tried everything, I have had it working but cant seem to figure out what combination of what gets it to work. Hopefully someone else has experienced this and has a simple fix. Thanks for help in advance this is getting very frustrating.
    Athlon PC Windows XP Apple 30 inch HD Display

    Plug in the display's USB cable, and then download and install WinACD drivers for the display. Google for WinACD.

  • Need a Help to Run the EJB client

    Hello Friends,
    I'm using EJB3.0. while running my client side bean I got a Exception like this " javax.naming.NameNotFoundException: maheshwaran.count not bound." I'm new to EJB so i couldn't find specifically what is the mistake in my files.
    I created the following files. It are listed below
    FileName: count.java
    "package maheshwaran;
    public interface count {
    public int count();
    public void set(int val);
    public void remove();
    FileName2 : countBean.java
    "package maheshwaran;
    import javax.ejb.*;
    import javax.interceptor.Interceptors;
    @Stateful
    @Remote(count.class)
    @Interceptors(countCallBacks.class)
    public class countBean implements count{
    private int val;
    public int count(){
    System.out.println("count()");
    return ++val;
    public void set(int val){
    this.val=val;
    System.out.println("set()");
    @Remove
    public void remove(){
    System.out.println("remove()");
    FileName3: countCallBacks.java
    " package maheshwaran;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.ejb.*;
    import javax.interceptor.InvocationContext;
    public class countCallBacks {
    @PostConstruct
    public void construct(InvocationContext ctx){
    System.out.println("cb:construct()");
    @PostActivate
    public void activate(InvocationContext ctx){
    System.out.println("cb:activate()");
    @PrePassivate
    public void passivate(InvocationContext ctx){
    System.out.println("cb:passivate()");
    @PreDestroy
    public void destroy(){
    System.out.println("cb:destroy()");
    The client side class is following: countClient.java
    "package maheshwaran;
    import javax.naming.*;
    public class countClient {
    public static final int noofClients=3;
    public static void main(String args[]){
    try{
    Context ctx=new InitialContext(System.getProperties());
    count count[]=new count[noofClients];
    int countval=0;
    System.out.println("Instatntiating Beans");
    for(int i=0;i<noofClients;i++){
    count=(count) ctx.lookup(count.class.getName());
    count.set(countval);
    countval=count.count();
    System.out.println(countval);
    Thread.sleep(100);
    System.out.println("Calling count on Beans");
    for(int i=0;i<noofClients;i++){
    countval=count.count();
    System.out.println(countval);
    count.remove();
    Thread.sleep(50);
    }catch(Exception e){e.printStackTrace();}
    The Deployment Descriptor file is following: ejb-jar.xml
    "><?xml version="1.0" encoding="UTF-8?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLschema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <description>Stateful Session Bean Example</description>
    <display-name>Stateful Session Bean Example</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>countBean</ejb-name>
    <business-remote>maheshwaran_dd.count</business-remote>
    </business-remote>
    <ejb-class>maheshwaran_dd.countBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <interceptors>
    <interceptor>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    <post-construct>
    <lifecycle-callback-method>construct</lifecycle-clallback-method>
    </post-construct>
    <post-activate>
    <lifecycle-callback-method>activate</lifecycle-callback-method>
    </post-activate>
    <pre-passivate>
    <lifecycle-callback-method>passivate</lifecycle-callback-method>
    </pre-passivate>
    </interceptor>
    </interceptors>
    <assembly-descriptor>
    <interceptor-binding>
    <ejb-name>countBean</ejb-name>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    </interceptor-binding>
    </assembly-descriptor>
    </ejb-jar> "
    please help me to rectify this problem.
    Thanks & regards,
    Maheshwaran Devaraj

    Hi,
    user586 wrote:
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
    SELECT  coupon          -- or whatever columns you want
    FROM    table_x
    WHERE   expirationdate  NOT BETWEEN  SYSDATE - 30
                                AND      SYSDATE + 30
    ;

Maybe you are looking for