How to deal future objects and wait calls

Hi all,
How can I handle Future objects if the Callable object calls a wait() into the call() method? If the Callable object is waiting for something, the call Future.get() throws an IllegalMonitorStateException.
For example:
public class Test {
    private final ExecutorService POOL = Executors.newFixedThreadPool(1);
    private static Random r = new Random(System.nanoTime());  
    List<Callable> waiting = new ArrayList<Callable>(10);
    public Test() {
        Future[] res = new Future[10];
        for (int i = 0; i < 10; i++) {
                res[i] = execute();  
        synchronized (res) {
            for (int i = 0; i < 10; i++) {
                try {
                    System.err.println(res.get(10L, TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (TimeoutException e) {
POOL.shutdown();
System.err.println("size: " + waiting.size());
private Future<Integer> execute() {
return POOL.submit(new Executor());
* @param args
public static void main(String[] args) {
Test t = new Test();
private class Executor implements Callable<Integer> {
public Integer call() throws Exception {
Integer value = -1;
try {
value = r.nextInt();
waiting.add(this);
wait(2000);
} catch (InterruptedException e) {
// Thread.currentThread().interrupt();
waiting.remove(this);
return value;
The Object.notify() documentation says:
"This method should only be called by a thread that is the owner of this object's monitor. A thread becomes the owner of the object's monitor in one of three ways:
* By executing a synchronized instance method of that object.
* By executing the body of a synchronized statement that synchronizes on the object.
* For objects of type Class, by executing a synchronized static method of that class.",
so how can the main thread became the owner?

Hello,
HR objects are not supposed to be in the SPAU list during the upgrade. It might show though because of the coding error in note 519678. The error wrote entries of HR objects in the tabel SMODILOG which is not supposed to be.
You can try the solution in the note 519678 to remove the entries of HR objects in SMODILOG and after that they will no longer be shown in SPAU.
Regards,
Joe

Similar Messages

  • How to handle lock object in BDC  call transcation method?

    Hi,
    how to handle lock object in BDC  call transcation method?
    Thanks In advances.

    If you are updating Z-fields then you need to create a lock entry, before you use call transaction.
    After creating lock object, please use FM Enqueue_<lockname> before CALL transaction and FM Dequeue_<lockname> after you have commited your data.
    Thanks,
    Kartavya

  • How to store Connection object and call it from other programs.

    Hi,
    I am trying to connect to the database, store the connection object and use this connection object from other standalone java programs.
    Can any one tell me how to do this? I've tried in the following way:
    In the following program I am connecting to the database and saving the connection object in a variable.
    public class GetKT2Connection {
       public static void main(String[] args) {
          String url = "jdbc:odbc:SQLDsn;
          String dbUser = "sa";
          String dbPwd = "sa";
          Connection kt2conn = Connection connection = java.sql.DriverManager.getConnection(url, dbUser, dbPwd);
          if(kt2conn == null) {
             System.out.println("Database Connection Failure!");
          else {
             System.out.println("Connected to Database...");
         GetKTConnectionObj.storeKT2ConnectionObj(kt2conn);
    } Here is the program to save connection object in a variable.
    public class GetKTConnectionObj {
       static Connection kt2Connection = null;
       public static void storeKT2ConnectionObj(Connection conn) {
       kt2Connection = conn;
       public static Connection getKT2ConnectionObj() {
       try {
          return kt2Connection;
       catch(Exception e){
          System.out.println(e);
      return null;
    }Now from the following code I am trying to get the connection object that is stored. But this is throwing NullPointerException.
    public class Metrics_Migration {
      public static void main(String args[]) {
         try {
        java.sql.Connection connection_1 =   GetKTConnectionObj.getKT6ConnectionObj();
         catch(Exception e){
    }

    kt2Connection is null. You need to store it first, to make it not null. Otherwise it will stay null forever. And why on earth are you trying to do this THIS way?
    If you are running the two applications separately, it wont work either.

  • How to execute a commit and wait via bol transaction context?

    Hi All,
    Currently a service contract is created via bol objects.
    Once all the objects are created, the modify() method is called bol_core instance.
    After that, the bol transaction context is assigned and the save() and commit() methods are called.
    This works fine, but the commit does not wait for the database to be updated before moving to the next steps.
    How can i get something like the 'commit work and wait' statement via the bol transaction context?
    would a commit work and wait statement work the same?
    regards,
    Leng

    Hi,
    It is a CRM specific issue.
    so the code sniplet is:
    go_bol_core = cl_crm_bol_core=>get_instance( ).
      go_bol_core->load_component_set( 'BT' ).
    create factory for BTorder
      go_bol_factory = go_bol_core->get_entity_factory( 'BTOrder' ).
      gs_param-name  = 'PROCESS_TYPE'.
      gs_param-value = 'ZSC1'.
      APPEND gs_param TO gt_param.
      go_btorder ?= go_bol_factory->create( gt_param ).
    send changes
      go_bol_core->modify( ).
      go_transaction_context = go_btorder->get_transaction( ).
        lv_success  = go_transaction_context->save( ).
        IF lv_success EQ abap_true.
          go_transaction_context->commit( ).
    so after the commit, it does not commit to the db straight away.
    i asked a collegue, and i got this:
    Using the BOL commit should perform the commit in one of two ways u2013 depending on the how the application (i.e. the GENIL layer has been implemented). It will either do a commit work and wait, or use a local update task and commit work statement. So based on this the update should be synchronous i.e. it should wait for the update to finish. In the case of the one order transaction it basically runs the update in local task.
    Basically i don't understand why it is behaving as it is.

  • How to organize Data Objects and other Objects in SWCV

    Hi,
    I am looking for Best Practices on how to organize data objects in SWCV as well as other objects such as a Distribution Rules.
    We are planning to develop three occasionally connected applications with NW Mobile 7.1 this year and maybe additional one the following year. We will create multiple Standard Data Objects (e.g. Plant, Company Code, Reservations, ...) which are shared in the first set of transactions and in the future transactions.
    I have heard before to separate out Standard Data Objects from Distribution Models and have two different SWCV.
    Should I have a) one SWCV for all current and future Standard Data Objects and one for the distribution rtules or b) should I separate out common data objects into one SWCV, and all transaction-specific data object each into separate SWCV?
    Just wondering if there are any best practices available for this so that I won't run into problems in the future when we want to add more transactions/data objects?
    Any advise is appreciated.
    Thanks,
    W. Berger

    Hi Siva,
    Thanks for quick reply!!
    I have created say SWCV1 for Dataobjects.
    Now i want to create seperate SWCV2 for defining distribution model.
    How i should proceed..I cannot see the uses option while creating new SWCV2  ( Only option i see is  'backward compatibility checkbox : uses NW04/NW04s MI Application')
    where to check the following which you have mentioned?
    SWCV2 was created and inherited SWCV1 in uses tab of SWCV2.
    Thanks in advance!!
    Regards
    Devendra

  • How to deal with conflict and potential conflict classes?

    Some classes are marked as conflict and potential conflict classes in the Classloader Analysis Tool.
    How to deal with them?
    How to use suggested solutions?

    Not double load them.
    Conflicting classes can lead to weird exceptions. One obvious example would be if you package
    an older servlet.jar version into your application and use the weblogic classloading features, such
    as prefer-web-inf-classes, to tell weblogic to use this class instead of the one provided in the
    system classpath. This one example which leads to weird exceptions, such as connot process jsp tag...
    If you really need a the version of the jar for your application, you have to test it through and through
    so that you know you do not run into weird production errors.

  • Impact Analysis: How to trace which objects and tables used in a report?

    Impact Analysis: How to trace which Webi objects and tables used in a report?
    Currently, our company have been using BO Webi as our ad-hoc and reporting tool for over a year now.  Past several months, we've been pushing our power users to develop their own report, and started to notice that we loss track off which data (tables, columns, ... , BO objects) being used where and by whom.   The BI team now spend more time tracing through reports manually, instead of designing Universe.
    After consulted with our local  SAP  technical sale, they said the only solution is to buy BO's ETL (Data Integration) and
    Metadata Management tool, which price starting from $300K per CPU.  I suppose that is NOT the right solution; however, we have not found one yet.  Some executives believe Cognos (now by IBM) would provide a better BI solution as we scale.
    If anyone know, please provide (1) Impact Analysis method: How to trace which Webi objects and tables used in a report? and (2) Does Cognos provide better impact analysis method without a heavy spending?
    Thank you very much,
    Ed
    Edited by: EdPC-SCB on Sep 8, 2009 3:56 PM

    EdPC-SCB,
    have you tried enabling auditing?
    - Yes, audit log only shows user's activities which isn't useful for us. Please let us know any audit log that might be helpful .
    For most of the servers listed in the CMC there is an "Audit" tab.  I'd say if you have the disk space in your database for Auditor available, then if in doubt turn it on (at least for a while) to see if it exposes what you are seeking to find out --that'd be the quickest way.  The documentation (xir2_bip_auditor_en.pdf) doesn't offer much in helping you to see a correlation between ticking on an Audit option in a Server and how it will populate in the Auditor DB -- most of us just hunt and peck until we get what we want.  Once you have the good stuff in each of the Servers ticked on you'll be able to track down which report recieves which object.  To help youself out initially, you should run every report that you can find so Auditor will get seeded.
    thanks,
    John

  • Animation: how can I move objects (and their transform keyframes)?

    Hi,
    I have created a project with a group of layers which all move (have transform keyframes set up).
    Now I want to move the group, but when I do this and then run the animation, the position of all the transform keyframes I have set up remain in the same place.
    Is there some way to move a group of objects and the location of their transform keyframes at the same time, or will I have to go through each keyframe and move them individually?
    Thanks!
    Jack

    > PLEASEEE HELPP
    You need to get some understanding of HTML and CSS to know
    why building a
    web page is not like using a page layout program or even a
    word processor.
    Unfortunately that will require some effort on your part.
    You cannot just place things on the page in HTML - you need
    to build an HTML
    infrastructure to hold the elements you want to appear on the
    page, and to
    hold them in the location where you want them to appear. As a
    simple
    example, consider a 1 row by 2 column table, where each
    column is set to 50%
    width, and the table itself is 800px wide. An image placed
    into the second
    column will be located exactly 400px from the left margin of
    the page
    (assuming a) the image is less than 400px wide, b) the table
    has zero
    borders, cellspacing and cellpadding, and c) there is nothing
    wider than
    400px in the first column.
    Make sense?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "afsheenm" <[email protected]> wrote in
    message
    news:fftbo8$cok$[email protected]..
    > hi, its my first time making the website so i have no
    clue about anything.
    > how
    > can i move text box? i mean i wrote something and want
    to move its
    > position
    > like up or down, how can i move it? also tables??????
    sometimes i can move
    > them
    > , by chance but i have no clue how i did it? PLEASEEE
    HELPP.
    >

  • How to compare 2 Objects( and )?

    Should I write an interface?

    Java has 2 interfaces that would be of interest to you.
    They both are designed to return an integer that describes the relationship between two objects.
    Suppose you have two objects: objectA and objectB
    The return value is as following:
    if (returnValue < 0) then objectA precedes objectB. (A < B)
    if (returnValue > 0) then objectA follows objectB. (A > B)
    if (returnValue == 0) then objectA and objectB are equivalent (A == B).
    It is up to you to do the comparing and determine which is the correct return value...
    Here are the two interfaces:
    1) Comparable interface (java.lang.Comparable)
    You would use this interface when you have a class that exhibits some natural order..
    You add this interface to the class, and, within the class, implement the following method:
       public int compareTo( Object obj )
       The variable obj in this case refers to the "other" object that you want to compare.
       public class MyClass implements Comparable // <--- notice the last two words!!
              other methods.
          public boolean isTallerThan( MyClass mc )
             // just some method i made up to compare...
          public int compareTo( Object objectB )
             // You are comparing "this" object with the "otherObject"...
             // Note that objectA is "this".
             MyClass otherObject = (MyClass)objectB;
             // Do whatever you need to compare the two.
             if (this.isTallerThan(otherObject) )
                 return -1;
             else if ( otherObject.isTallerThan(this) )
                 return +1;
             else
                 return 0; // they are of equal height...whatever...
       2) Comparator interface (java.util.Comparator)
    You could use this interface if you have a different set of standards with which to compare two different objects. Usually, it is it's own class, designed for only this purpose. You implement the following method:
       public int compare( Object objA, Object objB )
       Notice that in this case you have to explicitly pass in both objects to be compared, whereas in the Comparable interface, objA is implicitly assumed to be the object on which the method is called (or as I like to call it, this).
    Here is an example:
       public class MyComparator implements Comparator
          public int compare( Object objA, Object objB )
             do whatever comparisons you need to determine whether
             objA < objB (-1 is returned)
             objA > objB (+1 is returned)
             or
             objA == ObjB (0 is returned)

  • How to get Request object and LDAP user

    Hi All,
    How to get Request object, coz i want to see the out put of this code
    IUser myUser = request.getUser();
    String uid=myUser.getUid();
    I want to get only LDAP user from the server, for that i am having  code but i think this code is returning me all user from the server.
    com.sap.security.api.IUser user = null;
    try {
          IUserFactory userFactory = UMFactory.getUserFactory();
         IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();
    ISearchResult searchResult = userFactory.searchUsers(searchFilter);
       int count = 0;
        List list = new ArrayList();
         while (searchResult.hasNext()) {
                      count++;
                       String uniqueid = (String) searchResult.next();
                        user = userFactory.getUser(uniqueid);
                        list.add(user.getUniqueName());
    This code is giving me all user from the server LDAP and as well as portal user.
    But i want only LDAP.
    Please help me out. It's urgent.
    Regards,
    Deepak

    Hi
    use the following code
    //Request
    IWDRequest = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
    //User
    IWDClientUser = WDClientUser.getCurrentUser();
    Regards
    Ayyapparaj

  • How can i include  'Objects and Attachments' in the Decision Step ?

    i found some relevant threads for this particular topic but not able to solve my problem , so i thought of openeing new thread.
    My requirement is to fill the 'Objects and Attachments ' in Decision step with a  display method of purchase order number.
    From SAP Inbox , when i click on Objects and Attachments , it should navigate to Display method of my BOR object with the Purchase order number.

    Hi Sanju , i did exact the same way  ,
    &_EVT_OBJECT& --> &BUS2012&  ( This is done at the start of workflow )
    Now go to you task of the user decesion and make the following binding....
    &BUS2012& --->&_ATTACH_OBJECTS&  in the biding step between decession task and workflow container.
    I am getting this error message paul,
    The Object Types '[BO.ZIPARI]'  (source) and  '[BO.SOFM]' (target) are not compatible.
    i am trying to create a method in BOR and passing back the attachment back to task container but not succeeded yet .
    My requirement is , from SAP inbox before taking decision , approver wants to review for that i need to link the PO number clickble at 'Objects and Attachments'.

  • How to block the incoming and outgoing calls by programmatically

    I want to block incoming and outgoing calls from my application. Is it possible?

    For App Development questions, please post in the Development Forums made available to you as a Developer.  We cannot answer these questions here.
    https://discussions.apple.com/community/developer_forums

  • How to reduce an object and also the stroke together.....?

    Hi,
    The subject line was not easy to convey what my problem is.
    Here goes.
    When I have a stroke on an item and I shrink it the stroke stays the same so it looks fatter.
    Is there a way to stop this from happening?
    So when I reduce a vector image I dont have to seek out the object and manually adjust the stroke.
    I hope this makes sense
    Im sorry but English is my first language....
    Cheers

  • How to create rotating cursor and wait symbol?

    hello,
    I am creating one frame and from hat frame I call nother panel. It takes some time to display (30 seconds).
    So, I need to display some stuff that tell please wait some time like messages in some blink sytuff and also the cusor must be rotatable.
    how can i do?.

    Hi Ramesh;
    you can display wait cursor by using setCursor(Cursor.WAIT_CURSOR) method on your frame object.

  • How to make my object to wait for server response

    Hi ,
    I need some one suggestions on thread concepts.
    First Let me know my scenario is fit for thread concept.
    is it possible then how I can reach to solution.
    I have scenario like
    I send a request to server and server is taking some time to process the request.
    if I am calling the method on server it showing no results bez i know server takes some time.
    for that my calling method has to be wait for some time.
    Thanks
    Babu H

    Hi ,
    Let me give more information about that between my java class and server
    i have the bridge library which is also written in other than java.
    for that i used the njawin tool make as java wrapper class and accessing the java wrapper class(Bridge Server).
    the java wrapper class has post_request and poll_response methods so that why i 'm using only these methods in my java class to access the server.
    exactly I don't which technology is resided in Brdige server and actual Server bez that has been developed some one.
    poll_respnse means server has posted the response to client.
    Thanks
    Babu H

Maybe you are looking for

  • Venda Intercompany – Preenchimento dos campos xPed e nItemPed

    Boa tarde Pessoal, Andei pesquisando mas sem sucesso por isto venho pedir ajuda. http://scn.sap.com/thread/3263202 http://scn.sap.com/thread/3274014 https://scn.sap.com/thread/1838307 No ECC: O cenário standard de venda intercompany é muito similar a

  • Disk Utility: Unable to create "ImageName.dmg" error -39

    Ladies, Gentlemen, I used Disk Utility to backup the internal hard drive of my iMac G5 iSight. The last backup of the hard drive was unsuccessful, ending with next message: Unable to create "ImageName.dmg"; error -39. The iMac is running OS X 10.4.11

  • Julian date query

    Hi, I have on one column in which I have data like [634798640030000000,0].Now I have to convert this data into date format like dd/mm/yy.Could any one help me how do I convert this data into date format.

  • Invisible messages at sxmb_moni

    All, I have created SOAP to RFC service, and I am facing a strange phenomena. After sending a soap request (via XMLSpy ; and obviously getting a correct answer) I can monitor the message throw RWB (message monitoring) but cannot see any message at th

  • Text knockout CS4 - white text on black urgent

    I am having problems with some white text (converted to paths) which is placed on a black background.. When viewing the pdf in Illustrator (CS4), the text shows up fine. When viewing in Acrobat (which the printers will print from), the white text has