Is it possible to release a blocked thread in Java or by JNI through JVM?

Expert please help me, or where can I refer to find the correct answer.
Thank you.

Try Thread.interrupt() and/or explicitly closing the resource that it is blocking on.

Similar Messages

  • "Exception in thread "main" java.lang.UnsatisfiedLinkError:"  JNI in Linux

    Hi,
    I am writing a simple program to understand how JNI works so that I can use this concept to develop a project. But after running the simple code,
    It gives the following error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: sum
    at TestJni.main(testJni.java:25)
    My Java code is:
    import java.io.*;
    import java.util.*;
    class TestJni
    // Try to load the native Code library for user Authentication.
    static
    try
    System.loadLibrary( "test" );
    catch( UnsatisfiedLinkError e )
    System.out.println("Could not load native code for user authentication." );
    System.exit(1);
    public static void main( String [] args )
    //TestJni obj = new TestJni();
    System.out.println(TestJni.sum(2, 3));
    public static native int sum( int x, int y );
    TestJni.h looks like:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class TestJni */
    #ifndef IncludedTestJni
    #define IncludedTestJni
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: TestJni
    * Method: sum
    * Signature: (II)I
    JNIEXPORT jint JNICALL Java_TestJni_sum
    (JNIEnv *, jclass, jint, jint);
    #ifdef __cplusplus
    #endif
    #endif
    and my C++ code is:
    #include <jni.h>
    #include "TestJni.h"
    #include <stdio.h>
    JNIEXPORT jint JNICALL Java_TestJni_sum(JNIEnv *env, jclass obj, jint x, jint y)
    printf("Inside the native function\n");
    return (x + y);
    Then I am generating my .so file as:
    g++ -o libtest.so sum.cpp -shared -fpic -lcrypt -I//usr/lib/j2se/1.4/include -I/usr/lib/j2se/1.4/include/linux
    and copying the libtest.so file into the folder where I have my TestJni.class file. Then running the java code by:
    java TestJni
    but it gives the "UnsatisfiedLinkError". What to do? :( I have spend 2 days now to solve this problem but I am not getting it.
    I am using ubuntu 7.10 as my OS.
    Please let me know if you can help.

    Thanks for your response. I found that, when I copied the shared library to /usr/lib and
    did: ldconfig -n /usr/lib it worked
    But the problem is, this is my computer, but the computers that I am going to run my actual
    JNI application, have restrictive permission. Could anyone please let me know how I can
    do the work without ldconfig. I mean is there anyway I can configure my .so file's path without
    copying it into the /usr/lib folder and without ldconfig?
    I will appreciate any reply. Thanks.

  • Vendor already released from block,but showing block while creating pr-help

    dear friends,
    my client is facing a problem in blocking of vendors.
    my client actually blocked the vendor in XK05 t-code. after some days again he want the same vendor. so they release the block, that is they removed the tick mark for block (for purchase organization, company code) and again they take the vendor for the usage.when they are creating PR by using this vendor. it is giving error: stating that :VENDOR xxxxxx BLOCKED FOR PURCHASE ORGANIZATION xxxx.
    so we have blocked the vendor and again released the block and take the vendor for usage.but again it is giving the same error when creating PR.
    What is the solution for this ?
    we have checked is there any blockage on financial side.we used the t-code FK04.
    IN T-CODE FK04, it is showing new and old fields. in new field it is showing blocked state of vendor (denoted by symbol :-X )
    kindly give your valuable solution for this.
    thanks in advance.
    regards,
    FLEMMINGS

    Hi Flemmings,
    this posting in which I explained about subrange, would help you:
    Hi,
    (Note, in purchasing data view of vendor master, you can see Alternative Data)...When this is activated with plant, it activates vendor data maintainable at Plant Level...Which means, you can mark a vendor to be blocked at plant level ...select check box for plant level purchasing data....then when you hit enter, it shows you vendor master at porg and plant level!!! then you can see a new meanu activated under extras--> Purchasing Block...You can never see this before, without doing this step....
    Try if some one played around...
    In standard SAP it is not possible to block a vendor at plant level. However, I have extensively researched on vendor sub-range functionality and I could make it possible.
    When you go to XK02 or MK02, maintain vendor subrange. When you select plant level data there, it allows you to maintain purchasing data at plant level. Using this, you can maintain purchasing data for the vendor at a plant level. When you are in this view at plant level, select the menu path, Extras-->Purchasing Block (you will never see this menu except in the subrange activated plant level view) it gives a pop-up on which there will be a check box to activate "Purchasing Block". If you select this, vendor is blocked at the plant level for that P Org. When you create a PO using this subrange (caution! it works only for that subrange) (subrange value can be entered at the Item details (material data tab) of the PO, system gives an error message" : Vendor 1046971 blocked for purch. org. 0150, vendor sub-range 1, and plant 0353
    Message no. ME008
    Diagnosis
    The indicator Purchasing block has been set in this vendor's master record.
    Procedure
    Choose a different vendor.
    Its a very impressive solution; If you can somehow get the subrange defaulted (and not changeable) for this vendor in the PO whenever the POrg and Plant matches your details, it becomes a standard functionality. Perhaps, a little bit of ABAP would make it.
    Reward if it helps!
    Regards
    Message was edited by:
            Gopala Turaga

  • Reuse a waiting/blocked thread

    Using the API in java.util.concurrency, there are operations such as BlockingQueue.take() or Condition.await() that makes the current thread to be blocked (waiting) on the operation to complete. I am working on a problem in which, in such situation, it is very costly to leave the thread as such holding all the resources already allocated for it. I would like to use the same thread to run/execute another task. And, when the condition or take can continue their work, then the resources are allocated back to the thread (including the local state) such that the thread can continue the execution from the blocked/waiting point. So, my question is that is there any way to release the thread when it is blocked on some concurrent operation such that it can be used for other executions?
    On a related ground, is there any way I can replace the Thread class implementation in Java/JVM?
    My current impression is that since some parts of the implementations are native so we need to tweak the C++ code, is that correct?
    Thanks in advance.

    i think you are missing the point of what i'm saying. i'm saying you don't need to change how threads work, you need to change your style of programming. having multiple tasks run on the same physical thread is as easy to do in java as it is in erlang (as Peter Lawrey described). what you need to do is use the erlang style of programming, where a thread does not block waiting for something to happen, but is instead giving a task when there is work today. i.e. you need to write your tasks so that they are essentially non-blocking. you can do this just fine in java without mucking w/ the jvm.
    for instance, say you have a standard model with 3 queues, 3 producers, and 3 consumers, where there is 1 producer and 1 consumer per queue, and the consumer is a dedicated thread. in this scenario, if a queue is empty, that thread is idle/useless. instead, you can change your model around so that instead of each producer putting "data" on the queue, they instantiate a "handler/consumer" (instance of Runnable) with a reference to the data to be handled. this handler is then tossed into a thread pool with 3 threads. in this scenario, your 3 threads are now "general purpose" and can work on whichever queue(s) happen to currently have data. (in essence, you are collapsing your 3 queues into 1 queue and making the queue data "smarter"). this is exactly what erlang is doing under the hood.
    Edited by: jtahlborn on Jul 28, 2011 11:34 AM

  • Release GR blocked stock 105 from 103 twice

    i received my stock to gr blocked stock 103 after that i want to release it partial with 105
    i want to release one 103 document to many 105 document (fi famous problem account  .problem is :line items which already released comes again is it possible when i release gr blocked stock  with reference to material document to retrieve unreleased line items only?

    Hi
    At my end system gives error if I try to released material document which is al;ready released before.

  • Is it possible to set billing block when create delivery?

    Hi,
    Is it possible to set billing block flag when create delivery automatically,I know it is possible to do it in SO, I also want to know is there any T-code can release billing block in so and delivery by batch?
    Thanks in advance.
    Lance

    You can set Billing Block at Order level only. However iof you want to apply Billing Block, while doing Delivery, you require to go back to Sales Order & set the Billing Block. Incase you want Billing Block for all Deliveries, then Identify a user exit & activate it such that the coding of it will go to Sales order in Change Mode & set a Billing Block.
    Regards,
    Rajesh Banka

  • Release Orders Blocked for Delivery

    Hello Experts!!
    We have V.23, release orders blocked for billing.. is there a similar transaction where we can release orders blocked for delivery??
    Help is greatly appreciated.

    Hello Carla,
    Yes in the T-code "V.23", you can release the billing block for SALES ORDER in one single click. While releasing the delivery block for the Sales order the following T-code are useful:
    1. VDBLOCK
    2. V.14
    3. VA14L
    When you are using these T-codes, you get the list of all the Sales order which are blocked for Delivery. Then you can select the document for which you want to remove the delivery block and do the required updation.
    Regards,
    SARTHAK

  • Error while releasing credit block for the order

    Hi all,
    I am getting follwing error while releasing credit block for the order in VKM1
    Incorrect index structure for table IVBEP1
    Text
    Incorrect index structure for table IVBEP1
    Diagnosis
    Internal error.
    Procedure
    Repeat the transaction.
    If the error occurs and you have a CRM System connected to your SAP R/3 System, the document may have been archived in the CRM System.
    If the error occurs again, inform your system administrator. If the error cannot be corrected, call the SAP Hotline directly. Describe which steps preceeded the error.
    But we are not transfering any orders to CRM.The order can be only seen in R/3
    Please assist
    Regards
    Mano

    Hi
    KIndly check the oss note 505876 in may help you
    Regards
    Damu

  • Automatic release of blocked Invoices

    Note - Posted this qns in Financial forum & the user suggested to post the same question in this forum.
    Hi All,
    Scenario - A PO is placed with GR based IV unchecked. The vendor is sending the material & invoice to us. But the material is to arrive from overseas & hence there is a delay, but in the meantime i have posted the invoice in the system & the system blocks this invoice. I can check the blocked invoices in MRBR. At the moment to release it, i would have to use transaction MRBR, but I would like to know is there anyway, that the system can be configured to automatically release this blocked invoice, once the GR for that material is done, without me having to use any t-code?
    Vivek

    Hi Steve,
       There are 3 blocking reasons in MRBR,
    1. Blocked due to variances
    2. Manual Payment Block
    3. Stochastically blocked
       In this case, what is the reason for blocking?. If it is reason 1, then if i schedule a MRBR with automatic release, then would it release all those invoices as well which have been blocked due to price variation? or would it only release those Invoices which have been blocked due to non-receipt of GR?
       Also would like to know, is there anything in customizing, where i can define, say if the Purchase Order has got a Shipping Notification control key entered, then release this invoice?
       In customizing Financial Accouting -> Accounts Receivable & Accnts Payable -> Business Transaction -> Release payment
        Would this be of any help to me for resolving the issue at hand?
    Vivek

  • Payment release for blocked invoices.

    Dear Fi Gurus,
    How to  release payment block. Not through MRBR. Through workflow i want release. please advice
    Ex invoive is having 1 lakh. we want to relase payment one invoice 50%like partially
    Regards

    Hi,
    You can do that by F-53. Use Partial Payment or Residual Payment.
    Partial Payment: You will generate debit memo on vendor Invoice.
    Residual Payment: Clear Invoice and create another with remain amount.
    Hope it help

  • Export Release Build error - Exception in thread "main" java.lang.Error: Unable to find named traits

    I've been developing an AIR application for Android and iOS. During development, I've run the application (in debug mode) in the desktop simulator as well as on an iPhone 4 and a Nook Tablet.
    However, I recently tried to "Export Release Build" for iOS and hit the following error: (I've stripped out the package and class information in the error message below)
    !ENTRY com.adobe.flexbuilder.project 4 43 2012-04-06 13:09:15.516
    !MESSAGE Error occurred while packaging the application:
    Exception in thread "main" java.lang.Error: Unable to find named traits: valid.package.path.here::ValidClassName
              at adobe.abc.Domain.resolveTypeName(Domain.java:231)
              at adobe.abc.Domain.resolveTypeName(Domain.java:148)
              at adobe.abc.GlobalOptimizer.sccp_eval(GlobalOptimizer.java:6665)
              at adobe.abc.GlobalOptimizer.sccp_analyze(GlobalOptimizer.java:5909)
              at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4628)
              at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3514)
              at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2215)
              at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:526)
              at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:336)
              at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:472)
              at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:82)
    Compilation failed while executing : ADT
    !STACK 0
    java.lang.Exception
              at com.adobe.flexbuilder.project.internal.FlexProjectCore.createErrorStatus(FlexProjectCore. java:1019)
              at com.adobe.flexbuilder.util.logging.GlobalLogImpl.log(GlobalLogImpl.java:66)
              at com.adobe.flexbuilder.util.logging.GlobalLog.log(GlobalLog.java:52)
              at com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVersionWizard.doPackage (ExportReleaseVersionWizard.java:283)
              at com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVersionWizard.performFi nish(ExportReleaseVersionWizard.java:152)
              at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
              at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
              at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
              at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
              at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
              at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
              at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
              at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
              at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
              at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
              at org.eclipse.jface.window.Window.open(Window.java:801)
              at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersionAction$1.run(Export ReleaseVersionAction.java:97)
              at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersionAction.run(ExportRe leaseVersionAction.java:103)
              at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
              at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
              at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionI tem.java:584)
              at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
              at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java :411)
              at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
              at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
              at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
              at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
              at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
              at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
              at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
              at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
              at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
              at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
              at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
              at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
              at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
              at com.adobe.flexbuilder.standalone.FlashBuilderApplication.start(FlashBuilderApplication.ja va:108)
              at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
              at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:110)
              at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:79)
              at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
              at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
              at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
              at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    The class the error message is referring to is defined with a SWC that my project links to. However, I've even tried to define a class with that same name (and location) within my project and it still fails to find it.
    Why am I able to Project->Clean and run this project within the desktop AIR player (or on the device in debug mode) but unable to export it as a release build?
    I have found a couple of threads mentioning a similar error but none of them have been marked as resolved.

    At this point I feel I am talking to myself, but I will share my work-around in case it helps another who may stumble across this post.
    In my particular case, both my main AIR application and my ANE wrapper library were referencing the same external Flex library (same revision). Both projects had the library linkage set to merge. Changing the linkage to "External" on one of the 2 libraries (it doesn't seem to matter which) and leaving the other as "Merged into code" enabled the export to complete without the bizarre "Unable to find named traits" error.

  • Verizon Lumia Icon Denim update teased for possible February release

    Fingers crossed
    Verizon Lumia Icon owners are a passionate crowd and seemingly asking on a daily basis when the promised Lumia Denim update for their phones will be delivered. In late 2014 it was promised for "early 2015" but now we're into 2015 folks are getting itchy update fingers once again. Microsoft's Joe Belfiore is the target of a number of questions on the subject, and he's got a couple of things to say about it today.
    "Lumia icon people asking what I meant by "early 2015": The first part of the year. In my mind that means jan/feb or so. Less likely March."
    "Know that Vzw & MS are actively, daily working on getting it done. The test process has unpredictability so we can't say a firm end date"
    Since January is done with that would suggest Microsoft and Verizon are aiming to push it out in February. But as with the second statement, it could easily slip due to circumstances beyond Microsoft's control. But it hasn't been forgotten about, at least.
    Source:  Verizon Lumia Icon Denim update teased for possible February release | Windows Central

    I doubt it. JB's tweets were very, very vague and the very fact that he had to mention March means it's a lot more likely than not to be pushed past February.
    I take this as a very bad sign for this phone. We've been hearing soon since September.

  • Hello Community. My ipod nano 7g has been stolen - is there a possibility to find and block it if the ipod is connected via itunes?

    Hello Community. My ipod nano 7g has been stolen - is there a possibility to find and block it if the ipod is connected via itunes?

    Nope.  You can report the theft to the police, and that's about it.

  • Release of Blocked invoices

    MRBR is a transaction which is used for releasing blocked invoices.
    However, MRBR releases the entire items of an invoices.  In our case, for certain invoices, some portion is 'retention amount' which should not be paid to the vendors. 
    How can we achieve the release of blocked invoices without releasing the retention part ? (We cannot allow FB02 to remove the block from the items..)

    If you need to pay "Partial payment to the Vendor, there are two ways.
    1. F-58 or F-53, Manual payment - Partial or Residual
    2. OBB9, configure the Payment term with Instalment amount and pay it through F110
    Hope it  helps
    Thanks
    Edited by: nkonnipati on Jan 9, 2012 7:28 AM
    Edited by: nkonnipati on Jan 9, 2012 7:34 AM

  • How to Release the blocked Sales orders?

    Hi Gurus,
      Requirement: To Release the Blocked Salesorders
      problem: find out  any Tables  and procedure  to release blocked SO(allow to creating delivery for SO).
    how to Customer CreditLimit  and  Tables  of Theses...............
    Thanks in Advance..
    sivakumar.kasa

    Hi..
    AS per i knew......
    how to know cutomer CreditLimit?
    FD32,FD33...tcodes
    how to release blocked Sales order?
    VKM3
    Wait for some other views

Maybe you are looking for

  • Master - Detail application problem navigation

    Hello everyone i have a problem with my proyect Master - Detail Application, i can't show more DetailViewController  in the xcode 4.2. in the MasterViewController have 4 options the first option show me a DetailViewController in the second option sho

  • Zooming in on a still image

    Hello, I have followed many tutorials from the net and although I have been able to achieve a zooming in effect on a still, it isn´t exactly that. Instead the whole image becomes bigger and bigger giving a false sense of a zoom in - the still comes t

  • HT2729 rental movie on iPad

    where do i find a rental movie transferred from mac to iPad? mac says it is synced but can't find on iPad.

  • White desktop background

    Hi everyone. I'm having a problem with my Macbook's desktop wallpaper. It's stuck on white and won't let me change no matter what I do! Everything else works perfectly fine and it's not a pressing matter, but I must admit it's quite annoying. Any sug

  • [Class] Description of an attribute

    Hi all, Is there a FM or class to retrieve the <b>description associated to an attribute</b> of an ABAP class (SE24) ? <i>Usually, when created, it is defaulted to the description of the underlying type by it can be overwritten.</i> For the moment, I