Java Webservice calling C function through JNI

I have a java class that is using the JNI to call native interface written in C. The called C function has dependencies in vendor supplied c function library in .lib (CAUEVT.LIB) format. I compiled the C function as .DLL file and put the .DLL file in the -Djava.library.path and same thing I put in the opmn.xml file for the Java option.
Now, when I run the Java class from command line it works fine and makes call to the external system everything works fine.
However, when I deploy the same as web service and try to test the web service, Java expects the external library also in .DLL format (The error message is "This application has failed to start because CAUEVT.dll was not found. Re-installing the application may fix this problem")
If I look the application log file, I see the following error.
java.lang.UnsatisfiedLinkError: D:\lib\CAEventLoggerImp.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
I am wondering if the java class can run without any problem, why is the webservice execution fails....?

The problem was that when Java loads the shared DLL we create from the java.library.path setting, but if the loaded DLL refers to any other DLL, it expects it from the System path. And for some reason, OC4J, doesn't expose all the system path unless entered in the Evnironment Variable explicitly in the Administration tab in OEM., server properties in the OEM. (opmn.xml)
IT works fine after these changes.

Similar Messages

  • Calling a function through JDialog

    Hi all,
    The title might be a bit confusing, but the topic is about the following:
    I've got a JFrame as the main application. From the main application a JDialog gets called when you want to see more about an item in the JFrame.
    Because I want to collect all clicked information in the JDialog(so you can see what you've click before) I want to have the old JDialog with his current information + the new information at the moment you click on a other item.
    Example:
    JFrame mainFrame = The_CollectorApp.getApplication().getMainFrame();
    gameInfoBox = new The_CollectorCollectionDialog(mainFrame, tempGame, "game");
    gameInfoBox.setLocationRelativeTo(mainFrame);
    The_CollectorApp.getApplication().show(gameInfoBox);
    For opening a new JDialog with the game content. Now when you click on an other game, I want this gameInfoBox been showed (easy, just enter the last line only ), but I also want to pass the new Information to this JDialog.
    In the CollectionDialog.java is a function called AddItem(), so I want to call this function from the main when the JDialog has already been made.
    With a normal object gameInfoBox.addItem() would be enough, how to do this trick with this setup?

    Sounds like a bit of re-architecting might be in order. I haven't bothered deciphering your description of the flows, but the very fact that UI widgets are apparently trying to affect what other UI widgets are showing tells me you need something like MVC to keep things under control. Have a look into that pattern, MVC

  • JSP  Call  C  Library  through  JNI  ?

    Hi experts :
    I has a jsp file which create a bean to call native c method.
    It still works fine after 10 to 14 times' page refresh, then
    it throws exception when call a native method.
    If I restart the Tomcat it works again ,but shuch situtation repeat again.
    Should I notice any issues when access native c library
    through JNI in jsp ?
    Environment:
    SPARC 64 Solaris 7
    Tomcat 4.0.4
    JDK 1.3.1-04

    hi CTSteven
    Did you find a solution for this JNI-Problem ? I think i have the same problem as you. Would be great to here from you.
    Thank you.
    Bye
    Lukas

  • Problem with calling a function through onclick event in a tag

    Hi All,
    I have a text which should act as a link.
    On click of this text i need to display the table in the same page.
    this is how i want to do
    !<_ a     !st y l e='cursor pointer' h_ r  ef ='  #' !o n cl ick = " l o a dtc () "  _> display table _<  /  _a  _ >
    !<   % if i_ref = ' X' % _>
    !<   !h t m lb : t a bleVi ew id =" tv_vbak " tabl e= <  %  = it_vbak  % _ >
    !< s_c rip  t t y p e  =   "te  xt/ja  v a s c r ipt" >
    !f unct io n lo a dt c ()
    i_ref='X'.
    !<  _/ s c r i pt _>
    here am setting a flag and if that flag is set i will display the table.
    Please ignore the unewanted characters in my code. i was not able to paste the code directly.
    Thanks,
    Sandeep
    Edited by: SandeepReddy on May 25, 2010 9:22 AM

    Hi Sandeep,
    are you using javascript to get the link in the text view?
    i will tell u onething clearly.
    if you are using javascript in ur code, debugging will not wrk properly , what you need to do is add the alert in between so that you can know whether that particular code is wrking or not ok. 
    2) to call the javascript from the textview or the inputfield you have a attribute called onClientClick you need to call the function there and implement that function in javascript.
    <htmlb:textView text   = "<%= i_str %>"
                            design = "EMPHASIZED"
                            onClientClick = loadtc() />
    add ur javascript code ok
    cheers
    Bhavana
    Edited by: Bhavana Amar on May 25, 2010 10:25 AM

  • How call parent function through the module

    Hi, i want to call the function of parent application which add the module can you tell how i can do it???

    As long as you have the custom event classes accessible with import myClassDir.myClassSubdir.*;
    you should be able to create custom events with var myEvt:MyCustomClass - new MyCustomClass(); and then dispatchEvent(myEvt);
    You can communicate with the main app using mx.core.Application.applilcation or using parentDocument or parentApplication, though custom events are the way to go.
    If this post answers your question or helps, please mark it as such.

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,
          I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created this function in BRFPLUS and is working fine .Now I have to call it through ABAP code.Can someone kindly  provide me with the probable code for this scenario.
    E.g:
            ZT_MATNR  is the table in brfplus representing the list of MATNR values input along with other such inputs to function module Z_FM
            ZT_ATM   is the  resultant output table  of the function  which contains several fields.
    Now I have to call this BRFPLUS function with help of ABAP code.Could someone kindly help.

    Hello ,
    There should be a number of BRF+ tutorials available in SCN which discuss the FDT APIs. You can have a look at them to get an idea of the various APIs available and their uses.
    For your usecase, you should do the following.
            lo_fdt_function         TYPE REF TO if_fdt_function,
            lo_fdt_result           TYPE REF TO if_fdt_result,
    * Get function handle
          CALL METHOD lo_fdt_factory->get_function
            EXPORTING
              iv_id       = lv_function_id
            RECEIVING
              ro_function = lo_fdt_function.
    where lv_function_id is the GUID of the BRF+ function . You can either make it a constant , or you can use a FDT API to get the function GUID from the BRF+ application name and function name.
    *   Set function context
        TRY.
            CALL METHOD lo_fdt_context->set_value
              EXPORTING
                iv_id    =
                ia_value =
    This is one way to set the input context ( pass the input to the BRF+ function to process ). There are other ways to do this as well. Which one you use would depend on the kind of input you want to pass.
    * Execute BRFPLUS function
      TRY.
          CALL METHOD lo_fdt_function->process
            EXPORTING
              io_context = lo_fdt_context
            IMPORTING
              eo_result  = lo_fdt_result.
    * Get result output
      TRY.
          CALL METHOD lo_fdt_result->get_value
            IMPORTING
              ea_value =
    Another direct way of doing it would be to use the method PROCESS of the class CL_FDT_FUNCTION_PROCESS.
    I have not gone into much explaination here , but it should provide you an idea of how you can go about it.Read the SCN docs on the APIs to get a better idea , or better still if you can get hold of a copy of the BRF+ book by Carsten Ziegler , you will get an end to end explaination of all BRF+ APIs in it.
    Regards,
    Indranil.

  • Transient java object instance from jvm through jni?

    Hello, All
    Sometimes I want manage the memory take by object instance,
    for example, If I want to design a cache which cache a huge number object.
    Then, there may two problems:
    1, May occur OutOfMemory error.
    2, I want like to manually reclaim the memory take by the cached object,
    not by gc, because it may take a little time to check the reference for gc.
    Just as you know, there is keyword transient for serialization.
    I want know if some same mechanism for object instance creating or release, managing memory by jni, or by some other way?

    No, since you're not supposed to do that. hence you can't really expect Java to provide the means...
    Maybe you can use classes like WeakReference etc. but that won't bypass GC.

  • Java webservice Call - Performance Issue

    I am running a multi value database on SOLARIS 10 and have JDK 6 (Latest Patch) installed, the issue i am having it that when i initiate the below command that i have a huge delay before the java process starts and performs, can anyone shed any light on this please?
    thanks
    java -jar /sanshare/java/PickToWebServiceAndBack_2.jar "https://wrpsoat:8002/soa-infra/services/default/GetARCustomerMasterTransactionWolcenAS/GetARCustomerMasterTransactionWolcenWS""GetARCustomerMasterTransactionWolcen""60000""<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:cus='http://something.co.uk/finsim/businessobjects/accountsreceivable/1.0/customerinvoicewolcenbim' xmlns:head='http:///enterprise/common/1.0/header' xmlns:cus1='http://something.co.uk/finsim/businessobjects/accountsreceivable/1.0/customerinvoicewolcenbio'> <soapenv:Header /> <soapenv:Body> <cus:CustomerMasterTransactionWolcenGetRq> <head:HeaderRq> <head:TransactionId></head:TransactionId> <head:ComponentId>1192121</head:ComponentId> <head:TransactionName>Wolcen_ARCustomerTransaction</head:TransactionName> <head:ServiceName>CallingWebService</head:ServiceName> <head:BatchId></head:BatchId> <head:Language>EN</head:Language> <head:FileName></head:FileName> <head:FilePath></head:FilePath> <head:Source>13</head:Source> <head:Target>1</head:Target> <head:HostName>machineName</head:HostName> <head:UserName></head:UserName> <head:UserRole></head:UserRole> <head:AdminEmail></head:AdminEmail> <head:ApplicationResponsibility></head:ApplicationResponsibility> <head:ControlFileFlag></head:ControlFileFlag> <head:EODFlag>Y</head:EODFlag> <head:TimeStamp>20130116T20:53:54</head:TimeStamp> </head:HeaderRq> <cus1:GetCustomerMasterRequest> <cus1:CustomerNumber>7023R02</cus1:CustomerNumber> <cus1:SessionID>16453_75234_aljt</cus1:SessionID> </cus1:GetCustomerMasterRequest> </cus:CustomerMasterTransactionWolcenGetRq> </soapenv:Body> </soapenv:Envelope>""""/sanshare/java/soalogs/""INET-10.3.204.152-1400|16453|75234927|1|SOA.DEBTORS.ACCOUNT"

    getting alot of errors that are similar to the below any idea what they mean, im not all that clued up on solaris so not sure what these mean:
    18590/1:     0.3983     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3984     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3985     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3986     stat64("/usr/ccs/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3987     stat64("/usr/local/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3988     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3989     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3990     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libc.so.1", 0xFFBFD8F8) Err#2 ENOENT
    18590/1:     0.3991     stat64("/usr/ccs/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.3991     stat64("/usr/local/lib/libc.so.1", 0xFFBFD8F8)     Err#2 ENOENT
    18590/1:     0.4025     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/server/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4029     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/lib/sparc/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4031     stat64("/usr/jdk/instances/jdk1.6.0_38/jre/../lib/sparc/libmd.so.1", 0xFFBFD9C0) Err#2 ENOENT
    18590/1:     0.4032     stat64("/usr/ccs/lib/libmd.so.1", 0xFFBFD9C0)     Err#2 ENOENT
    18590/1:     0.4032     stat64("/usr/local/lib/libmd.so.1", 0xFFBFD9C0)     Err#2 ENOENT

  • Java webservice calls static?

    Why when I insert a call to a web service from a generated client in NetBeans, the method it adds is defined as static.  Is there a specific reason for that?  It would make some of my standard coding easier if those calls were not static, and I can see no reason why they are created that way.

    I am not putting business logic in the calls.  The issue is that I have a lot of calls to web services that represent different types of data, but are similar in nature (have the same input and outputs).  So if I could put those calls in an abstract class as abstract methods, it would make writing the models that represent the data easier.  The issue I am coming up against is that you can not have a method that is both static and abstract at the same time.  I could create abstract methods that in the final class would call the static web service methods, but that seems to just add complexity to the system.  Where as if I could just define the web service methods as not static, things would be easier.
    Thank you

  • How to call matlab function through activex and execute in labview?

    Hi,
    I have created a gui based application in matlab and I wish to use back d same gui and run it as is it in labview. Can it be done with activeX? if so, may I know how to do it?

    Play around with this a little.  This is an example program I found on the WEB...I don't have Matlab so I can't run it.
    -Brett
    Attachments:
    Matlab_ActiveX_Example.zip ‏26 KB

  • Calling user defined functions through OBIEE

    Can anyone tell me how I can call the user defined functions on database through the new BI tool.
    The idea is to collect certain parameters through the prompt when launching the request, the function is supposed to pick up the parameters, make a certain calculation, and return a value.
    I wrote the function, I just need help over how to call the function through the BI tool - that was pretty easy in the old Discoverer.
    Thanks.
    Message was edited by:
    user611377

    Hi Kresimir ,
    You can use EVALUATE function to call a user defined function.
    EVALUATE('FUNCTIONNAME(%1,..)' As DATATYPE,parameter1,...)
    Here DATATYPE is the returntype of function.
    Hope this will help.
    Thanks
    Ashok

  • How can I call a function in C or C++

    hello friends, I want to write a prog. in Java to call a function written in C or C++ without disturbing the c/c++ function
    thanks

    Use the Java Native Interface (JNI). See the Java Tutorial at http://www.javasoft.com/docs/books/tutorial/native1.1/index.html

  • Is JMF use hardware accelerated through JNI possible?

    Dear all:
    I try to use JMF decode MPEG-2 data, through VeXP which wrote in C.
    So I think we can call C library through JNI pass encoded MPEG-2 data to VeXP, use hardware decode encoded MPEG-2 data to YUV-format raw data then return it to JAVA.
    but JNI seem can't pass media raw data by call by reference...
    It should cause a lot of memory copy.
    How about it's feasibility?
    Have anyone give me some suggestion?
    Regards,
    white

    There's a few ways to do it, but I'd use a style sheet. So:
    1. Add this to the "creationComplete" Stage event:   sym.$("<link rel='stylesheet' type='text/css' href='styles.css'>").appendTo("#Stage");
    2. Create a style sheet (text file) in your project folder named "styles.css", and define a class:
    .force-webkit-acceleration {
         -webkit-transform: translate3d(0,0,0);
    3. Give your animated element the class "force-webkit-acceleration" in the properties panel (the little c-in-a-box icon next to the title field).
    Be sure that the style sheet file ends up in your "publish/web" folder too.

  • Getting HeapDump on out of memory error when executing method through JNI

    I have a C++ code that executes a method inside the jvm through the JNI.
    I have a memory leak in my java code that results an out of memory error, this exception is caught in my C++ code and as a result the heap dump is not created on the disk.
    I am running the jvm with
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:HeapDumpPath=C:\x.hprof
    Any suggestions?
    Thanks

    I'll rephrase it then.
    I have a java class named PbsExecuter and one static method in it ExecuteCommand.
    I am calling this method through JNI (using CallStaticObjectMethod). sometimes this method causes the jvm to throw OutOfMemoryError and I would like to get a heap dump on the disk when this happens in order to locate my memory leak.
    I've started the jvm with JNI_CreateJavaVM and I've put two options inside the JavaVMInitArgs that is used to create the Jvm. -XX:+HeapDumpOnOutOfMemoryError and -XX:HeapDumpPath=C:\x.hprof
    which supposed to create a heap dump on the disk when OutOfMemoryError occurs.
    Normally if I would execute normal java code, when this exception would occur and I wouldn't catch it the Jvm would crash and the heap dump would be created on the disk.
    Since I need to handle errors in my C++ code I am use ExceptionOccured() and extracts the exception message from the exception it self and write it.
    For some reason when I execute this method through JNI it doesn't create the dump.

  • How to call a function from a JAR file

    Hi ALL,
    I am trying to call a Public function from a JAR file from my JAVA
    file. Can you please provide an example or suggest a good resource?
    Basically my java file Test.Java should call a function called 'export_a_doc' from a JAR file Export.jar. How do I refer this in my Java file and call 'export_a_doc'?
    Thanx

    Hi,
    HERE IS MY JAVA FILE
    // We need this for Starting our Export Process
    import com.newexport.Myclass;
    public class MyTest {
         // Our function to Start Export
         protected static void test(String[] args) {
         System.out.println("Starting. \n---------------------");
         Myclass p = new Myclass();
         try {
    p.Start_Export(args);
    System.out.println("Finished. \n---------------------");
         } catch(Exception e) {
    e.printStackTrace();
         public static void main(String[] args) {
         test(args);
    HERE IS THE BATCH FILE TO BUILD AND RUN
    cd \JNI\Srcs
    echo "-------------"
    c:\JBuilder7\jdk1.3.1\bin\javac -classpath C:\JNI\Export.jar MyTest.java
    echo "-------------"
    \JBuilder7\jdk1.3.1\bin\java.exe -classpath c:\JNI\Export.jar MyTest
    The Export.jar uses other jar files
    Raj

Maybe you are looking for

  • My Mirror options do not show up on my Macbook Pro with OS 10.8

    I can't mirror with my MBPro. I have OS 10.8, checked the "Show mirror options" in Display and it doesn't show up so I can project my MBPro on my Apple TV. Why?

  • Edit multi-level categorization

    Hi All, working on the multi-level categorization for service tickets. There are currently 4 levels and i want to extend this to 6 levels. Want to know how can i edit the existing categorization schema to add 2 new additional levels. Is anything to b

  • Stock value - some has value, some is non-valuated in same material number

    Hi, I have a condition here where in our company certain material (same material number) total qty is 1000 ea. The MAP is 10 USD. May be after a few months, the cost of 600 ea will be absorb by certain cost center(department). So, user request to zer

  • Thumbnails don't show in Finder or Stacks

    I use a MacBook Pro running OS X Leopard 10.5.6, VMware Fusion 2.0.2, Skitch and Pixelmator. As you can see, sometimes, OS X doesn't show thumbnails of pictures in Finder or Stacks. Everytime this happens, *I have to re-boot my Mac.* I have no idea w

  • Mail: moving emails between folders offline...

    Dear all, I have a question about Apple Mail. I am mainly considering using it to be able to use it offline, as it allows me to write email offline (for example in the train). My question is: can I organize my mailbox folders while offline? More prec