Calling dll in Java using The JACOB Project

Hi I'm trying to import and read the class and methods from a DotNet API (dll) in java code usind the Jacon Project does anybody know how to do it? (like and example or simple staps to have an idea)
thanks
Luca

afaik you cannot call windows API functions directly, you have to create a 'wrapper' method in C++ in order to access the API functions.
it will look something like
// Java code:
package a.b;
class Thingie {
  public native int doThatFunkyThingie();
// c++ code
jint Java_a_b_Thingie_doThatFunkyThingie(JNIEnv *env, JObject j) {
  // c++ function calls go here
}I haven't done JNI in over a year, so this is probably not entirely correct.
I recommend you read the JNI tutorial.
J

Similar Messages

  • Error in while calling a Soap Adapter using the UDF

    hi,
    i am trying to make a call to Soap Adapter using a UDF.
    The code of the UDF is as follows :
    InputStream isPayloadStream = null;
    AbstractTrace trace= container.getTrace();
    String sService="Business Component";
    String sChannelName="Soap Channel(Sender)";
    SystemAccessor accessor=null;
    trace.addInfo("entered UDF");
    StringBuffer sb = new StringBuffer(" ");
    trace.addInfo("creating the reference file");
    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
    sb.append("<ns0:MT_123082_UDF xmlns:ns0=\"http//infosys.com/pi/projects/png/n1\">\n");
    sb.append("<INTERCHANGECONTRLNOS>" + var1 + "</INTERCHANGECONTRLNOS>");
    sb.append("<PGPARTNERID>"var2"</PGPARTNERID>""\n""</ns0:MT_123082_UDF>");
    trace.addInfo("trigerring the SOAP channel ");
    try{
    Channel channel = LookupService.getChannel(sService,sChannelName);
    accessor = LookupService.getSystemAccessor(channel);
    isPayloadStream = new ByteArrayInputStream((sb.toString()).getBytes());
    trace.addInfo("creating the xml payload ");
    XmlPayload payload = LookupService.getXmlPayload(isPayloadStream);
    Payload result=accessor.call(payload);
    catch (Exception e){
    trace.addInfo(e.getMessage());
    finally{
    if ( accessor !=null) {
    accessor.close();
    return " ";
    The above code is throwing an error while end to end testing.
    the scenario is such,while graphical mapping a UDF will be used, which will create an Xml payload, and send this payload to another SOAP to file scenario.
    The error in the sxmb_moni is:  "Error when calling an adapter by using the communication channel CC_123085_UDF_SOAP_OUT (Party: , Service: BC_123082_REMADV_D96A, Object ID: fa9c6ee15efc30c68ec34b08034d87d1) XI AF API call failed. Module exception: 'failed to set up the channel fa9c6ee15efc30c68ec34b08034d87d1'. Cause Exception: 'Channel stopped by administrative task.'."
    Please can anyone suggest how this error can be rectified.
    regards,
    Meenakshi

    Hi,
    i have checked the communication channel and the XML. The following error occurs everytime i try to run the scenario.
    Error:
    Error when calling an adapter by using the communication channel CC_123082_UDFRECEIVER_SOAP_IN (Party: , Service: BC_123082_REMADV_D96A, Object ID: 2a895589066d30d4b2686e9d3a8d4c8d) XI AF API call failed. Module exception: 'SOAP Error'. Cause Exception: 'SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 400 Bad Request'
    Please let me know how this error can be resolved.
    Regards,
    Meenakshi

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • Screen Saver when calling and need to use the Keypad, the screen saver doesn't detect the phone has left the ear and blanks out the screen.  Even ending a call is difficult as the screen blanks out within seconds

    I have to use the Keypad a lot when making calls.  Make the call, the Robot then asks to enter a number for a service, pull the phone down from the ear, the screen may light up for a second, but then the screen saver cuts in, blanking the screen out.  Sometimes you hit the Home Key to awaken the sccreen, enter your number and then back to the ear to hear the next set of instructions.  Back and forth just trying to enter the options is a pain.  Sometimes even trying to end the call, the screen blanks out and you fight to try and end a call.
    If I use the Speaker function the keypad works; the speakler phone is not alway appropriate. 
    It appears that the phone gyro, doesn't detect the phone has moved from the ear to the viewing angle.  This wasn't an issue until recently and I can't remeber if it's the iPhone 5 or one of the updates.  It definitly wasn't there earlier on, as I threw away an Windows 6.5 phone for the same problem. 
    I'm not sure if it's a hardware or software (design) issue.

    It is not the gyro. This has everything to do with the iPhone's prioximity sensor.
    Are you using a case that may be blocking or partially blocking the proximity sensor? If you are using the case, remove the case prior to the next call to see if the same occurs without the case.

  • IF i'm on a call and try to use the internet function, I get an error message.  Is this normal?

    IF i'm on a call and try to use the internet function, I get an error message.  Is this normal?

    Depending on your carrier, with AT&T there shouldn't be a problem.
    If you with Verizon, you will need to be on Wifi, to do that.

  • Can I use the albums/project/folders in Aperture to display photo's with Apple TV ?

    Can I use the albums/project/folders in Aperture to display photo's with Apple TV on my TV?

    Yes, select the photos you want to share via the iTunes advanced menu.

  • [svn] 656: Added a short readme explaining how to use the Eclipse projects.

    Revision: 656
    Author: [email protected]
    Date: 2008-02-26 09:38:38 -0800 (Tue, 26 Feb 2008)
    Log Message:
    Added a short readme explaining how to use the Eclipse projects.
    Added Paths:
    flex/sdk/trunk/development/eclipse/readme.txt

    Revision: 656
    Author: [email protected]
    Date: 2008-02-26 09:38:38 -0800 (Tue, 26 Feb 2008)
    Log Message:
    Added a short readme explaining how to use the Eclipse projects.
    Added Paths:
    flex/sdk/trunk/development/eclipse/readme.txt

  • Calling DLLs in JAVA

    Hi,
    I need to create a utility for a component in a 3rd party tool. I am planning to create this utility in JAVA. But the problem is that the 3rd party tool uses DLLs which is created in VB 6.0 (Its seems so).
    I came across the key word "NATIVE" in JDK. But the examples related to this is all given for C/C++. I am not sure whether following the same procedure we will be able to access any VB dlls.
    Please help me out. I am aware that there are ceratin APIs which we can use as a Bridge between Dlls and Java. And If I am right one among such is JACOB. But I am trying to minimize the dependencies of my Java Code to any other Utilities.
    Eagerly waiting for a valuable Advice
    Jiju Jagadish

    Hi,
    It seems you'll need to compile you own DLL wrapper if you do not want to depend on 3rd party library, search for JNI spec here.
    On the other hand generic wrappers save time, if you are not famillar with C/C++.
    Look at that post : http://forum.java.sun.com/thread.jspa?threadID=722211&tstart=0
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • To read a DLL from java using JNI

    Hi,
    I had some DLL files (VB 5.0) which are providing interfaces. Is there any chance of accessing that using java (JNI). Also is there any De - Compiler available so that I can get the source code of the DLL file.
    Regards,
    Hari.

    Hola Hari
    To make a dll loadable through JNI, the interface
    inside
    the dll must be implemented the JNI way. Also a COM
    interface does not help.
    I would reccomend a certain product to automatise the
    JNI interfacing process, but that would
    require that you have the sourcecode of the dll
    available.
    But one thing you can do is to write a wrapper that
    contains the dll classes and is implemented the JNI
    way.
    More precisely you write an interface wrapper in c/c++
    that matches the methods of the dll and does use JNI
    methods. Now inside that c++ wrapper you load the dll
    and forward the calls from java to c++ vice versa.
    Download the demo version of CENTRO.java here:
    www.ablon.de
    Bye, nilsHi Nils,
    Thank you for your suggestion. Im new to JNI.
    That dll's are in Visual Basic. I don't have the source code of the dll file. I got the interfaces available in the dll file from a Visual Basic program which make use of the dll file(which we are talking about). As I know only the method signatures in the interfaces(dll file), I request you to kindly provide me some help to wrap it in C/C++ program.
    Thanks in advance.
    Regards,
    Hari.

  • Executing DLLs from Java using JNI vs Runtime.exec()

    I am trying to understand the best way to execute a dll using java. The dll I am testing with takes a few input parameter. If I use JNI with System.loadLibrary("dll"); what do I need to do to pass the arguements in as well? Can I just add the arguements in the java code like private int xyz = "value"; and expect that the dll will accept them or is there special definitions I have to set up in the dll to make it work?
    Alternatively I was looking at using Runtime to execute the dll by using Runtime.exec("dll param1 param2",env,filePath); Does anyone know if there are drawback to doing it this way vs. using JNI or is this just as efficient? Any help would be appreciated.

    You seem to be confused...
    "execute a dll using java"
    Unless I'm mistaken, a dll is not executable. A dll is a library of code. This code has (hopefully) some well-defined entry points (declared in a header file somewhere) which you must call in a C/C++ file. The arguments you pass to the dll will come from java through JNI.
    As far as your understanding of this entire process, it is obviously confused beyond the scope of a simple reply. I recommend you read the examples and ALL of the documentation available here:
    http://java.sun.com/docs/books/tutorial/native1.1/index.html
    When you get the/an example running (or just set up to run) then post your code and comments here for more help.
    Ian

  • Calling DLLs or Java from Business Objects

    Post Author: nmarks
    CA Forum: Other
    I'm a newbie so please go easy!
    Is it possible to invoke a DLL or Java bean when opening a Business Objects query or report?
    I've just started working for a very large insurance company in the UK.
    Each month the company produces reports for the Directors, for the Auditors and Industry Regulators.
    Most of the results that go into the reports are produced using an extremely expensive application called Prophet. It dumps out files with data in.
    Ideally the company would like to upload the results from Prophet into Business Objects and have nice numbers show on a report the directors can understand.
    The problem is that lots of fiddly adjustment calculations have to be done to the data coming from Prophet before it can be shown on the BO report.
    I have proposed that the adjustment calculations are done using a VB DLL which will be called automatically by Business Objects  when the user wants to see the report. Can this be done?
    Can Business Objects call a DLL?
    Your help is very much appreciated.
    Regards,
    Nick.

    Post Author: thangvq
    CA Forum: Other
    Hello,
    I think it can. At least I have done it with a DLL is compiled by Delphi. You may read the CR Developer's Help for more info. If you have installed the Developer Edition, its location is something like this: C:\Program Files\Business Objects\Crystal Reports 11\Developer Files\Help\En
    Thang

  • How to distribute the serial core only with my exe and DLL applicatio​n using the Labview applicatio​n builder 8.21. I'm not interested having MAX and other components installed on the customer PC and in the program menu

    Since Labview ver 8.0 and later, I am not very happy with the new way the project installer is managing the additional drivers such as Serial.
    With LV 7.11 the serial components was included in the cab file and was installed on the target computer in a specific directory. The size of the distribution was pretty small and well suited for compact distribution.
    My LV application use only the serial object and with LV 8.21, if I include the serial 3.2 component, I get an enormus file including max, visa ... and a lot of fucky component I do not need.
    To distribute my application, I just need, the runtime engine and the serial driver as it was with the version 7.XX
    Looking for clever advises from you gentlemen!

    Thanks Dennis for you input
    My problem is in fact very simple. 3 years ago, I developped a software suite for X ray generator; My company is selling such generator all over the world and our control panel software and DLL (for OEM integrator) is based on Labview professionnal development plateform.
    To drive our generator, we just need to transfer ascii data using the strandard RS232 port still present on most of equipments used in the industrial area.
    Until LV version 7.11, there was no problem to include serial component in my distribution with a very reasonable size and transparency for the end user.
    with LV 8.xx (preparing a new release), I'm very disapointed to see, my distribution is increased of about for 10 Mo to 180 Mo just because I increase the serial component.
    May I mix a previous version of the serial component with LV 8.21?
    Should I change my source to Visa instruction only and merge visa runtime only to my distribution?
    is there any simple serial example based on visa and distributed with th application builder?
    I will appreciate your help in order to optimize my distribution
    Pascal 

  • Build a DLL in LabVIEW & Use the DLL in LabVIEW

    I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
    I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
    It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
    I want to use this DLL in new vi with LabVIEW.
    Call library function used. I wrote a new vi to use that DLL.
    In config dialog I config each parameter for dll and connected terminals. but it doesn't work
    pleas refer to the attatched file and let me know what I missed.
    Attachments:
    Array1D.zip ‏60 KB

    At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...
    In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
    return type: void
    iteration: Numeric, Signed 32-bit Integer, pass by value
    array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
    len: Numeric, Signed 32-bit Integer, pass by value
    Then I called the DLL like this:
    Message Edited by smercurio_fc on 03-16-2007 12:57 PM
    Attachments:
    Example_BD.png ‏2 KB

  • Calling a Crystal Report using the ReportViewerBean

    Hello...I am writing a java application to display a Seagate Crystal report using the ReportViewerBean.
    The problem I am having is trying to display the report within the viewer.
    The following is a sample from my code where I create an instance of the viewer bean.
    ReportViewerBean rvb = new ReportViewerBean();
    JFrame frame = new JFrame();
    frame.setSize(1000,1000);
    frame.getContentPane().add(rvb,BorderLayout.CENTER);
    frame.show();
    rvb.start();
    try
    String strUrl = "http://localhost:8080/Report1.rpt";
    rvb.setReportName(strUrl);
    catch(java.beans.PropertyVetoException pve)
    System.err.println("Property change vetod");
    The Sys-out from the Report Viewer bean is "No reponse from server".
    The sysout from my server (Tomcat 3.2.3) is:
    2001-09-06 09:08:53 - Ctx( /Report1.rpt ): FileHandler: Ends with \/. D:\jakarta
    -tomcat-3.2.3\jakarta-tomcat-3.2.3\webapps\Report1.rpt\
    2001-09-06 09:08:53 - Ctx( /Report1.rpt ): 404 R( /Report1.rpt + + null) null
    2001-09-06 09:08:53 - Ctx( /Report1.rpt ): FileHandler: Ends with \/. D:\jakarta
    -tomcat-3.2.3\jakarta-tomcat-3.2.3\webapps\Report1.rpt\
    2001-09-06 09:08:53 - Ctx( /Report1.rpt ): 404 R( /Report1.rpt + + null) null
    Any suggestion/help would be greatly appreciated...TY

    I am getting the same 'No Response from Server' Message.
    URL = http://Pepperland/STPARMListing.rpt?viewer=java&vfmt=encp&vgen=728&pversion=3&language=en&promptOnRefresh=1
    Parameters = cmd=get_pg&page=1&incomplete_page=1&incomplete_page_count=1&smart_images=1
    No response from server.
    The WWW service and the Default Web Site are up and running.
    I tried configuring the application settings in the IIS MMC but I was unable to determine which .dll to associate with the .rpt extension.

  • Calling BDC from Java using JCO

    Hello Everyone,
    Is it possible to call a BDC from Java program using JCO ?

    Are you serious with that question? Did you try to build the web service client before? Because this is exactly the same. Try to find "building web service clients" instead "Calling BPEL from java". By default (probably) every BPEL process has both WSIF and SOAP end points, just use correct WSDL address.

Maybe you are looking for

  • Mail spam suddenly

    Running 10.7.5,  I have mail setup it has been working great for months.  In the last week though I have started getting tons of spam in the following format. From: Mail Delivery System To: My email address on the server Subject: Undelivered Mail Ret

  • Is it possible to copy a DVD to my itouch?

    If so, how?

  • Retrieving a Video

    Hi! Ive earase very important video...is therw any way i could retrieve it? Please im despirate..;(

  • Credit due: 1tv box not working since install, will not pay for this 3weeks+?

    finally had time to try troubleshoot tonight msg states: 'something is not quite right' after rebooting. Before this the msg was 'please give us a moment' last few times i tried over past few weeks I would get this, and no time to deal with having to

  • Why is my iPhone so slow

    Why is my iPhone 3G so slow. I deleted all pics and messages but it's still slow. When answering a call the slider bar won't move, it takes about 3 or 4 attempts. HELP! It's driving me insane.