Native method from dll

Hello, I am trying to call a dll:method. But I got the unsatisfiedLinkError. Can anyoen tell me way? Here is the code and teh dll:
[java code]
class Main
public static void main(String[] args)
HelloWorld hw = new HelloWorld();
hw.Java_Show_EM_Result();
class HelloWorld
public native void Java_Show_EM_Result();
static
System.loadLibrary("HelloWorldImpl");
[java code]
[dll delphi code]
library HelloWorldImpl;
uses Dialogs, JNI;
procedure Java_Show_EM_Result(Penv: PJNIEnv; Obj; JObject); stdcall;
begin
showmessage('Sweden for eurogold');
end;
exports
Java_Show_EM_Result
end.
[dll code]
The dll and the code is in the same directory
/Rikard

So I put some Duke Dollars to the topic to increase the interset. I realy hope that somone can help me.

Similar Messages

  • Accessing a native method from within a packaged class

    I have seen some very useful information from RPaul. However, I can not quite get it to work.
    I have a class "JNIGetUserId" that is in a package "com.services.localoptions". I am trying to call a native method from a dll. it works fine at the default package level. But not in the package. I have tried adding the "_" between each level of the directory in the h and c++ files. I also found that doing a javah at the top of the package structure it includes some information in the h file. A "_0005" shows up between each level.
    This is on Windows XP. I am also using VisualAge for Java. I also am using JDK 1.3.1.
    The source files:
    package com.services.localoptions;
    * This class provides the JNI Interface to call the
    * AD User Maintainence routines.
    * These routines are stored in the JNIGetUserIdLibrary.dll.
    * The routines are:
    * <ul>
    * <li>getUser - returns a string containing the User Id
    * <eul>
    * @author: Ray Rowehl
    * @date (10/15/2003 10:30:59 AM)
    public class JNIGetUserId
         // Load the library
         static
         try
              System.out.println("loading dll");
         System.loadLibrary("JNIGetUserIdLibrary");
         System.out.println("loaded dll");
         catch (UnsatisfiedLinkError ue)
              System.out.println("Link Error");
    * native C++ method to call getUserId routine
    public native String getUser() throws Exception;
    * This method allows us to test standalone..
    * Creation date: (10/16/2003 2:08:58 PM)
    * @param args java.lang.String[]
    public static void main(String[] args)
         try
              System.out.println("Trying method 3");
              JNIGetUserId lGUD = new JNIGetUserId();
              System.out.println(lGUD.getUser());
         catch (Exception e)
              System.out.println("Got an exception " + e);
              e.printStackTrace();
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class JNIGetUserId */
    #ifndef IncludedJNIGetUserId
    #define IncludedJNIGetUserId
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: JNIGetUserId
    * Method: getUser
    * Signature: ()Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_com_localoptions_JNIGetUserId_getUser
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    // Implements method to return a string to Java
    // C++ core header
    #include <iostream.h>
    // header from Java Interface
    #include "JNIGetUserId.h"
    #include "JNIGetUserId2.h"
    // returns a string back to Java for package structure
    JNIEXPORT jstring JNICALL Java_com_services_localoptions_JNIGetUserId_getUser
    ( JNIEnv * env, jobject thisObject )
         // set up constant user id for testing return
         char* userid = "RROWEHLP";
         // return userid to caller
         return env->NewStringUTF( userid );     
    // returns a string back to Java for flat structure
    JNIEXPORT jstring JNICALL Java_JNIGetUserId_getUser
    ( JNIEnv * env1, jobject thisObject1 )
         // set up constant user id for testing return
         char* userid1 = "RROWEHL1";
         // return userid to caller
         return env1->NewStringUTF( userid1 );     
    }

    Ok. A co-worker figured it out for me. The key thing is to do "javah com.services.localoptions.JNIGetUserId". Note the use of "." instead of "\". Running on windows, I was used to doing "\". That was part of the problem. Another key is doing the javah at the top of the package structure. This was mentioned in a post over at IBM.
    We got our JNI stuff working now. thanks, ray.

  • Access native methods from an applet

    hi all
    I am developping a applet which has to access the native method which is c++ code. but it does not work at all, even though it can be compiled well.
    it returns
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.MemoInfo)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkLink(Unknown Source)
         at java.lang.Runtime.loadLibrary0(Unknown Source)
         at java.lang.System.loadLibrary(Unknown Source)
         at InfoShow.<clinit>(InfoShow.java:24)
         ... 11 more
    who can give me some suggestions on accessing native method from applet! thx
    regards
    beginner

    you don't have access to native code from an applet unless you've modified your policy file or you're using a signed applet.

  • Call native methods from windows dll

    Hello all,
    I want to call BlockInput method from User32.dll. My source code looks something like this:
    public class User32Dll_1 {
         static {
              try {
                   System.loadLibrary("User32");
              catch (Exception ex)
                   ex.printStackTrace();
         public static void main(String[] args) throws UnsatisfiedLinkError {
              BlockInput (true);
         /** @param b
         * @dll.import("USER32")*/
         private static native boolean BlockInput(boolean bBOOL);
    And the problem is that I get the following exception:
    java.lang.UnsatisfiedLinkError: BlockInput
         at User32Dll_1.BlockInput(Native Method)
         at User32Dll_1.main(User32Dll_1.java:27)
    Exception in thread "main"
    Can someone provide me a solution for this?
    Thank you in advance!

    can't do
    use JACOB
    http://danadler.com/jacob/
    or
    http://www.ezjcom.com/

  • Why I can't call my native method from my package?

    it is fine if my java code didn't complied into a package.
    But if I complied my java code as a package, and call its native method outside. It give me "UnsatisfiedLinkError". And can not find my method. It is indeed the method is inside.
    Thank a lot any helps. Email me on [email protected]

    I have found that javah does not generate the correct JNI function names when the native function is in a class that is within a Java package. The net result is an Unsatisfied link error.
    The JNI function name must be included in the package name. The naming is a bit complicated and that's why javah should be used, except in this case it does not work. I can't quite remember exactly how it works, something like adding in packagename_1 into the JNI name. The SWIG tool (http://www.swig.org) does generate the correct names when using packages. It is a tool which takes C or C++ header files and generates the JNI and Java classes for you so that you can call C/C++ code from Java. Once you have installed SWIG and run 'make check', have a look in the directory Examples/test-suite/java for the JNI naming for packages. I'll try remember to post the exact naming if you don't want to install SWIG.

  • Urgent - How to call native methods from J2ME

    Hi,
    I have to do some very heavy processing work, so I have my code written in C. And now I want these native functions to be called from a J2ME application. I had thought this was not possible and J2ME did not support something like JNI as J2SE did.
    However, when contacted with Sun Technical Support we were advised to use KNI in J2ME. I went through the KNI documentation and did not find any example to do so.
    On reading about it I understood that it cannot be implemented by developers as the native functions if any using KNI should be implemented while compiling the KVM.
    I would like to know whether my understanding is correct, or is it possible to call native functions from J2ME. Say I would like to have my native functions called from J2ME and run it on my Nokia N73 or other such phones.
    Experts please clear this.
    Regards,
    Kamalakshan

    Hi,
    You are right in your assumptions regarding KNI. Here is some related thread that might also help. There has been [some work|http://developer.symbian.com/main/downloads/papers/MIDlet_Native_Services_Framework/MIDlet_Native_Services_Framework_v1.1.zip] done in accessing native services through a MIDlet.
    Mihai

  • EXCEPTION_ACCESS_VIOLATION  while calling a native method.....

    Hi guys,
    i am trying to call a native method from my java code, but i am getting this following error,
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x052bd55f, pid=2740, tid=3884
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
    # Problematic frame:
    # C [F3BC1ENG.DLL+0xd55f]
    In the log file,
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x052bd55f, pid=2740, tid=3884
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
    # Problematic frame:
    # C [F3BC1ENG.DLL+0xd55f]
    --------------- T H R E A D ---------------
    Current thread (0x03b26e50): JavaThread "httpWorkerThread-8080-0" daemon [_thread_in_native, id=3884]
    siginfo: ExceptionCode=0xc0000005, reading address 0x05e71000
    Registers:
    EAX=0x31304443, EBX=0x05d048f0, ECX=0x0c4c0d16, EDX=0x05e70000
    ESP=0x2c76ef38, EBP=0x2c76f034, ESI=0x05e71000, EDI=0x05d06d20
    EIP=0x052bd55f, EFLAGS=0x00010213
    Top of Stack: (sp=0x2c76ef38)
    0x2c76ef38: 00000001 052a9264 2c76f228 052a92a4
    0x2c76ef48: 01190002 00000000 00000000 00000000
    0x2c76ef58: 00000000 ffffffff 00000002 05d05d38
    0x2c76ef68: 00000000 00000000 00000000 00000000
    0x2c76ef78: ffffffff 7c9106eb 00000004 00000000
    0x2c76ef88: 00000000 00000000 00000000 00000000
    0x2c76ef98: 00000000 00000000 00000000 00000000
    0x2c76efa8: 00000000 052bf3e1 2c76efd4 0000101f
    Instructions: (pc=0x052bd55f)
    0x052bd54f: 00 8b 7c 24 2c 8b 4a 18 8d 72 18 8b c1 c1 e9 02
    0x052bd55f: f3 a5 8b c8 eb 16 8b b4 24 bc 00 00 00 8b 7c 24
    Stack: [0x2c670000,0x2c770000), sp=0x2c76ef38, free space=1019k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [F3BC1ENG.DLL+0xd55f]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j palmsecuresdk.sample.PvsAuthenticationJNI.identifyMatch(I[BLjava/util/List;ILjava/util/List;)I+0
    j packService.palmsImpl.identify([B)Ljava/lang/String;+55
    j packService.palmsSEI_Tie.invoke_identify(Lcom/sun/xml/rpc/server/StreamingHandlerState;)V+50
    j packService.palmsSEI_Tie.processingHook(Lcom/sun/xml/rpc/server/StreamingHandlerState;)V+58
    j com.sun.xml.rpc.server.StreamingHandler.handle(Lcom/sun/xml/rpc/spi/runtime/SOAPMessageContext;)V+819
    j com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+394
    j com.sun.enterprise.webservice.JAXRPCServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+139
    j javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+139
    j javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
    j org.apache.catalina.core.ApplicationFilterChain.servletService(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/Servlet;Lorg/apache/catalina/util/InstanceSupport;)V+93
    j org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+644
    j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
    j org.apache.catalina.core.StandardPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+3
    j org.apache.catalina.core.StandardContextValve.invokeInternal(Lorg/apache/catalina/Wrapper;Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+238
    j org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+252
    j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
    j com.sun.enterprise.web.WebPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+53
    j org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+89
    j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
    j com.sun.enterprise.web.VirtualServerPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+149
    j org.apache.catalina.core.ContainerBase.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+6
    j org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+58
    j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
    j org.apache.catalina.core.StandardPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+3
    j org.apache.catalina.core.ContainerBase.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+6
    j org.apache.coyote.tomcat5.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+296
    j com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter()V+19
    j com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(Ljava/io/InputStream;Ljava/io/OutputStream;)Z+15
    j com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(Ljava/io/InputStream;Ljava/io/OutputStream;)Z+25
    j com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask()Z+74
    j com.sun.enterprise.web.connector.grizzly.ReadTask.doTask()V+161
    j com.sun.enterprise.web.connector.grizzly.TaskBase.run()V+1
    j com.sun.enterprise.web.connector.grizzly.WorkerThread.run()V+22
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x037aec00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2664]
    0x0376bb10 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=4020]
    0x03a526c0 JavaThread "Thread-25" daemon [_thread_blocked, id=2508]
    0x03a3b8e8 JavaThread "Timer-5" daemon [_thread_blocked, id=2260]
    0x03a51e18 JavaThread "Timer-4" [_thread_blocked, id=2192]
    0x035bae38 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[__JWSappclients]]" daemon [_thread_blocked, id=2548]
    0x035fac10 JavaThread "httpWorkerThread-4848-1" daemon [_thread_blocked, id=3492]
    0x03786530 JavaThread "httpWorkerThread-4848-0" daemon [_thread_blocked, id=1952]
    0x035fa9e8 JavaThread "SelectorThread-4848" [_thread_in_native, id=408]
    0x03576828 JavaThread "httpWorkerThread-8181-1" daemon [_thread_blocked, id=1964]
    0x0356ee10 JavaThread "httpWorkerThread-8181-0" daemon [_thread_blocked, id=3476]
    0x00c29278 JavaThread "SelectorThread-8181" [_thread_in_native, id=3512]
    0x03acb208 JavaThread "httpWorkerThread-8080-1" daemon [_thread_blocked, id=3472]
    =>0x03b26e50 JavaThread "httpWorkerThread-8080-0" daemon [_thread_in_native, id=3884]
    0x03bea780 JavaThread "SelectorThread-8080" [_thread_in_native, id=1500]
    0x03606198 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv]]" daemon [_thread_blocked, id=3788]
    0x03b57620 JavaThread "SingleSignOnExpiration" daemon [_thread_blocked, id=3528]
    0x03b5fb58 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[]]" daemon [_thread_blocked, id=3480]
    0x03c03d58 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[newPalmService]]" daemon [_thread_blocked, id=3524]
    0x03629bf0 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[palmSecure_ws]]" daemon [_thread_blocked, id=3560]
    0x03acbee8 JavaThread "SingleSignOnExpiration" daemon [_thread_blocked, id=2308]
    0x0374f418 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[]]" daemon [_thread_blocked, id=2708]
    0x03601a88 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[web1]]" daemon [_thread_blocked, id=2284]
    0x03b4e748 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[asadmin]]" daemon [_thread_blocked, id=680]
    0x037e4ac8 JavaThread "Timer-3" [_thread_blocked, id=2100]
    0x03a97b08 JavaThread "RMI RenewClean-[192.168.10.19:1464]" daemon [_thread_blocked, id=2080]
    0x037a7f38 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=1580]
    0x03a4a050 JavaThread "RMI TCP Accept-8686" daemon [_thread_in_native, id=1316]
    0x0379ccd0 JavaThread "Thread-15" [_thread_blocked, id=316]
    0x03771d20 JavaThread "Thread-14" [_thread_blocked, id=228]
    0x0376bcf0 JavaThread "Thread-13" [_thread_blocked, id=436]
    0x0373d2a8 JavaThread "RMI LeaseChecker" daemon [_thread_blocked, id=904]
    0x0373aa68 JavaThread "RMI RenewClean-[192.168.10.19:1429,com.sun.enterprise.admin.server.core.channel.LocalRMIClientSocketFactory@ac4d3b]" daemon [_thread_blocked, id=2320]
    0x00c66dd0 JavaThread "Timer-2" daemon [_thread_blocked, id=1512]
    0x038e3350 JavaThread "Timer-1" [_thread_blocked, id=2272]
    0x03a4ac60 JavaThread "Thread-10" [_thread_in_native, id=4052]
    0x03a6fc88 JavaThread "Thread-8" [_thread_in_native, id=1052]
    0x03a43818 JavaThread "Thread-7" [_thread_in_native, id=2600]
    0x03a1e808 JavaThread "Thread-6" [_thread_in_native, id=1648]
    0x03a1ac20 JavaThread "GC Daemon" daemon [_thread_blocked, id=4084]
    0x03a52e18 JavaThread "RMI Reaper" [_thread_blocked, id=144]
    0x03a52c30 JavaThread "Timer-0" daemon [_thread_blocked, id=208]
    0x03a3d730 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2044]
    0x00c17020 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3456]
    0x00c15bf0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4064]
    0x00c14ed8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4060]
    0x00c0fd90 JavaThread "Finalizer" daemon [_thread_blocked, id=4044]
    0x00c0e8c0 JavaThread "Reference Handler" daemon [_thread_blocked, id=2436]
    0x0032df88 JavaThread "main" [_thread_blocked, id=1532]
    Other Threads:
    0x00bdc778 VMThread [id=4028]
    0x00c31a20 WatcherThread [id=4068]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 11712K, used 4051K [0x06a70000, 0x07720000, 0x11510000)
    eden space 10432K, 27% used [0x06a70000, 0x06d435b0, 0x074a0000)
    from space 1280K, 90% used [0x075e0000, 0x077017d8, 0x07720000)
    to space 1280K, 0% used [0x074a0000, 0x074a0000, 0x075e0000)
    tenured generation total 25784K, used 15468K [0x11510000, 0x12e3e000, 0x26a70000)
    the space 25784K, 59% used [0x11510000, 0x1242b290, 0x1242b400, 0x12e3e000)
    compacting perm gen total 26880K, used 26785K [0x26a70000, 0x284b0000, 0x2aa70000)
    the space 26880K, 99% used [0x26a70000, 0x28498618, 0x28498800, 0x284b0000)
    ro space 8192K, 67% used [0x2aa70000, 0x2afcd9f8, 0x2afcda00, 0x2b270000)
    rw space 12288K, 46% used [0x2b270000, 0x2b813808, 0x2b813a00, 0x2be70000)
    Dynamic libraries:
    0x00400000 - 0x00406000      D:\Sun\AppServer\lib\appserv.exe
    0x7c900000 - 0x7c9b0000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000      C:\WINDOWS\system32\kernel32.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d730000 - 0x6d8c7000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000      C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f56000      C:\WINDOWS\system32\GDI32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000      C:\WINDOWS\system32\RPCRT4.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x6d2f0000 - 0x6d2f8000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x00a10000 - 0x00a27000      C:\Program Files\Common Files\Logishrd\LVMVFM\LVPrcInj.dll
    0x6d700000 - 0x6d70c000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\java.dll
    0x6d720000 - 0x6d72f000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\zip.dll
    0x6d530000 - 0x6d543000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\net.dll
    0x71ab0000 - 0x71ac7000      C:\WINDOWS\system32\WS2_32.dll
    0x71aa0000 - 0x71aa8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71a50000 - 0x71a8f000      C:\WINDOWS\System32\mswsock.dll
    0x76f20000 - 0x76f47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76fb0000 - 0x76fb8000      C:\WINDOWS\System32\winrnr.dll
    0x76f60000 - 0x76f8c000      C:\WINDOWS\system32\WLDAP32.dll
    0x76fc0000 - 0x76fc6000      C:\WINDOWS\system32\rasadhlp.dll
    0x04220000 - 0x04248000      C:\WINDOWS\system32\rsaenh.dll
    0x769c0000 - 0x76a73000      C:\WINDOWS\system32\USERENV.dll
    0x5b860000 - 0x5b8b4000      C:\WINDOWS\system32\netapi32.dll
    0x6d550000 - 0x6d559000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\nio.dll
    0x662b0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000      C:\WINDOWS\System32\wshtcpip.dll
    0x6d520000 - 0x6d528000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\management.dll
    0x6d670000 - 0x6d676000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\rmi.dll
    0x6d070000 - 0x6d1d7000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\awt.dll
    0x73000000 - 0x73026000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x76390000 - 0x763ad000      C:\WINDOWS\system32\IMM32.dll
    0x774e0000 - 0x7761c000      C:\WINDOWS\system32\ole32.dll
    0x73760000 - 0x737a9000      C:\WINDOWS\system32\ddraw.dll
    0x73bc0000 - 0x73bc6000      C:\WINDOWS\system32\DCIMAN32.dll
    0x73940000 - 0x73a10000      C:\WINDOWS\system32\D3DIM700.DLL
    0x6d2b0000 - 0x6d2ef000      C:\Program Files\Java\jdk1.5.0_07\jre\bin\fontmanager.dll
    0x7c9c0000 - 0x7d1d4000      C:\WINDOWS\system32\shell32.dll
    0x77f60000 - 0x77fd6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x773d0000 - 0x774d2000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5d090000 - 0x5d127000      C:\WINDOWS\system32\comctl32.dll
    0x05290000 - 0x0529a000      C:\WINDOWS\system32\PvsApiJv.dll
    0x052a0000 - 0x052ac000      D:\Java Project\PalmSecure\src\dll\PvFw.dll
    0x052b0000 - 0x052dc000      D:\Java Project\PalmSecure\src\dll\F3BC1ENG.DLL
    0x052e0000 - 0x0531f000      D:\Java Project\PalmSecure\src\dll\F3BC4CAP.DLL
    0x05320000 - 0x05344000      D:\Java Project\PalmSecure\src\dll\F3BC4COM.DLL
    0x73dd0000 - 0x73ece000      C:\WINDOWS\system32\MFC42.DLL
    0x05c50000 - 0x05cf7000      D:\Java Project\PalmSecure\src\dll\F3BC4MAT.DLL
    VM Arguments:
    jvm_args: -client -Xmx512m -XX:NewRatio=2 -Dcom.sun.aas.defaultLogFile=D:/Sun/AppServer/domains/domain1/logs/server.log -Djava.endorsed.dirs=D:/Sun/AppServer/lib/endorsed -Djava.security.policy=D:/Sun/AppServer/domains/domain1/config/server.policy -Djava.security.auth.login.config=D:/Sun/AppServer/domains/domain1/config/login.conf -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.rmi.dgc.client.gcInterval=3600000 -Djavax.net.ssl.keyStore=D:/Sun/AppServer/domains/domain1/config/keystore.jks -Djavax.net.ssl.trustStore=D:/Sun/AppServer/domains/domain1/config/cacerts.jks -Djava.ext.dirs=C:/Program Files/Java/jdk1.5.0_07/jre/lib/ext;D:/Sun/AppServer/domains/domain1/lib/ext;D:/Sun/AppServer/javadb/lib -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar -Dcom.sun.enterprise.taglisteners=jsf-impl.jar -Dcom.sun.aas.classloader.optionalOverrideableChain=appserv-ws.jar,commons-logging.jar,commons-launcher.jar -Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar -Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,D:/Sun/AppServer/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,D:/Sun/AppServer/lib/SUNWmfwk/lib/mfwk_instrum_tk.jar -Dcom.sun.aas.configName=server-config -Ddomain.name=domain1 -Djmx.invoke.getters=true -Dcom.sun.aas.promptForIdentity=true -Dcom.sun.aas.classloader.optionalOverrideableChain.ee= -Dcom.sun.aas.instanceRoot=D:/Sun/AppServer/domains/domain1 -Dcom.sun.aas.domainName=domain1 -Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,C:/Program Files/Java/jdk1.5.0_07/lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
    CLASSPATH=C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;C:\Program Files\Java\jdk1.5.0_07\jre\lib;.
    PATH=C:/Program Files/Java/jdk1.5.0_07\jre\bin\client;D:\Sun\AppServer\lib;D:\Sun\AppServer\lib;C:\Program Files\Java\jdk1.5.0_07\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:\Sun\AppServer\lib;D:\Sun\AppServer\bin;D:\Sun\AppServer\lib;D:\Sun\AppServer\bin;C:\Sun\share\lib;C:\Sun\share\bin;C:\PROGRA~1\Java\JDK15~2.0_0\bin;C:\Sun\MessageQueue\lib;C:\Sun\MessageQueue\bin;c:\oracledb\product\10.2.0\db_2\bin;D:\oracle\product\10.2.0\db_1\bin;c:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\wamp\php;C:\wamp\Apache\GnuWin32\bin;d:\Program Files\Microsoft SQL Server\90\Tools\binn\;D:\Java Project\PalmSecure\src\dll;D:\Java Project\PalmSecure\src\Lib;.;D:\Sun\AppServer\bin;;C:\Sun\AppServer;C:\Program Files\Java\jdk1.5.0_07\bin;C:\Program Files\Cvsnt;C:\Program Files\CVSNT\;D:\Java Project\PalmSecure\src\dll;D:\Java Project\PalmSecure\src\Lib;
    USERNAME=subbu.chandrasekaran
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 44 Stepping 2, AuthenticAMD
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 1 family 47, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 457904k(42684k free), swap 3464136k(2905608k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_07-b03) for windows-x86, built on May 3 2006 01:04:38 by "java_re" with MS VC++ 6.0
    what is the reason for this one....?
    In my case, whenever the user has clicked the Identify button then the native method Identify should be called. That time it's working fine.
    But once the user has clicked the Enroll button, then first the Identify native method should be called, based upon the result, the enroll() native method will be called. I am getting the error whenever i am clicking the Enroll button.
    while clicking the Identify button i didn't get any such error....
    What would be the reason?
    someone pls clear my doubt.
    --Subbu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

    You have a bug in your C code, and are attempting to access memory location 0.
    Look for an unitialized pointer.

  • Unable to call a native method

    Hi All,
    I am trying to call a native method tapi3Init from tapi3.dll present in Windows\System32 folder. But I get an error as below.
    Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: DLLCall.tapi3Init
         at DLLCall.main(DLLCall.java:25)
    I have verified my java.library.path and it has the path in it. I have cross verified by typing a wrong dll name and that gave a relevant error. So, please let me know what is going wrong?
    Also, is it not possible to call a native method from a dll which is not formed by using the javah header file?
    Thanks.

    native method tapi3Init from tapi3.dllSo that would be your JNI method.
    Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: DLLCall.tapi3Init And you are not calling it. Standard reasons apply.
    - library not loaded
    - Signatures are different.

  • Calling a native library from Java

    Hello,
    I'm trying to call a native method (windows dll) from a web service implemented in Java. I've confirmed that the class I've created to call the native method works when used outside of my web service (ie. in a standard Java application). However, when I try to use the class in the web service, an exception is thrown when
    System.loadLibrary("MyLibrary");
    is executed. The exception thrown is:
    InvocationTargetException
    JAXRPCSERVLET28: Missing port information
    Does any one have any suggestions as to what might be causing this error?
    Thanks

    There are basically 3 steps to calling a native method from your Java code.
    1. Create a C/C++ stub function that will translate between your Java call and the native C method.
    2. Create the dll that exports the stub function.
    3. Invoke the System.loadLibrary("myDllName") method.
    Here's what I did to learn how to use the JNI.
    I first created the class that would be calling the dll:
    public class CallDll
    /** Creates a new instance of CallDll */
    public CallDll()
    static
    //LVtoJava is my dll name.
    System.loadLibrary("LVtoJava");
    //AddDll is the name of the function I'm exporting from my Dll
    //It does not have to be static
    public native static double AddDll(int func, double x, double y);
    I then used the javah utility in the jdk/bin directory to create the C stub header file. Once you have the generated stub header file, you can create an implementation file, and compile it into a dll.
    //My C++ stub, generated by javah utility
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class LabViewDll_CallDll */
    #ifndef IncludedLabViewDll_CallDll
    #define IncludedLabViewDll_CallDll
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: LabViewDll_CallDll
    * Method: AddDll
    * Signature: (IDD)D
    JNIEXPORT jdouble JNICALL Java_LabViewDll_CallDll_AddDll
    (JNIEnv *, jclass, jint, jdouble, jdouble);
    #ifdef __cplusplus
    #endif
    #endif
    You may want to note the stub function's signature and how it decorates the function name that you created from your Java class. Do not modify it, as the format is required by the JNI. The javah utility appends the fully qualified package name and the word Java, separated by underscores, to your original function name. You do not need to change the name in your Java class.
    All the other special key words in the function's signature are defined in the jni.h or the jni_md.h (if your using windows).
    You may want to refer to the JNI documention on Sun's website. The book I learned out of is the Core Java Volume 2, published by Sun Microsystems Press. It goes through the details of invoking your first native function and I've found it to be a good reference.
    Hope this helps,
    PS. I seemed to have found the issue with calling my dll from a web service. My dll is actually calling another dll and that seems to be the source of my problems. When I removed the call to the 2nd dll, everything worked fine. So now I need to figure out why the 2nd dll call is an issue.
    Any suggestions?

  • Errors in compiling native method

    I am trying to call a native method from a java source program. I generated header file by javah and wrote c file for native method implementation. I work on RedHat Linux-7.2.
    Java file for native method:-
    class HelloNative
    {  public static native void greeting();
    static
    {  System.loadLibrary("HelloNative");
    Java file for calling native method(main java file):-
    class HelloNativeTest
    {  public static void main(String[] args)
    {  HelloNative.greeting();
    C file implementing native method:-
    #include <stdio.h>
    JNIEXPORT void JNICALL Java_HelloNative_greeting
    (JNIEnv* env, jclass cl)
    {  printf("Hello world!\n");
         I am using following command for compiling c source file:-
    cc -G -I/usr/java/jdk1.3.1/include -I/usr/java/jdk1.3.1/include/linux HelloNative.c -o HelloNative.so
    It gave me followig errors on compiling:-
    cc: unrecognized option `-G'
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
    collect2: ld returned 1 exit status.

    Looks to me like you're not telling the linker to create a library (DLL). I'm not familiar with Linux, but clearly if the linker if looking for 'main' then its trying to build an executable.

  • How to call java method from C ?

    Hello,
    I try to call a native method from java which calls java method from the same class. Exception (noSuchMethodError) is thrown. Any ideas?
    Thanx in advance !
    here is the source of the native method :
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall (JNIEnv * env, jclass jcl, jint jarg1, jint jarg2) {
    int arg1;
    int arg2;
    int arg3;
    jint res;
    char * ch = "test";
    jfieldID fid;
    jmethodID mid;
    int (* procedure) (int *, int * ,int *);
    int mch;
    arg1 = (int )jarg1;
    arg2 = (int )jarg2;
    procedure = GetProcAddress(libraryHandle,"Proc_Mul_Int_Var_Var_Stdcall");
    procedure(&arg1,&arg2,&arg3);
    res = (jint) arg3;
    printf("(*env)->GetMethodID(env, jcl, \"test\", \"()V\");\n");
    mid = (*env)->GetMethodID(env, jcl, "test", "()V");
    printf("(*env)->CallVoidMethod(env, jcl, mid);\n");
    (*env)->CallVoidMethod(env, jcl, mid);
    return res;
    here is the source of the java file:
    public class TestDll {
    static {
    System.loadLibrary("testdllwrap");
    System.out.println("java: Library testdllwrap.dll loaded");
    public TestDll() {
    public native int Proc_Mul_Int_Var_Var_Stdcall(int jarg1, int jarg2);
    public void test() {
    System.out.println("java: test()");
    public static void main(String[] args) {
    TestDll access = new TestDll();
    int a = 5;
    int b = 6;
    int c = 0;
    System.out.println("Calling Proc_Mul_Int_Var_Var_Stdcall");
    c = access.Proc_Mul_Int_Var_Var_Stdcall(a,b);
    System.out.println("Java Result = " + c);

    Something is wrong with the code you posted here.
    Since your native method is not static, it should have the jobject instance as a parameter in the function prototype, not a jclass. Also, you should be calling CallObjectMethod with a jobject, not jclass.
    Check out Jace at http://jace.reyelts.com/jace.
    To call the java method you would do:
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall
    (JNIEnv * env, jobject jTestDll, jint jarg1, jint jarg2) {
      TestDll testDll( jTestDll );
      testDll.test();
    }God bless,
    -Toby Reyelts

  • A way to set a flag in java layer when native method has been called?

    Hi,
    I'm calling a native method from the java layer through to a native c function. Is there a way I can set a flag in the java layer when this native method has been called?
    Thanks!

    1. Create a wrapper method. The wrapper method is the only exposed method. It calls the native method. It sets the flag.
    2. Set the flag in the native method itself.
    3. You might be able to use the debugging API to do this however it is going to require quite a bit of work. And it injects itself at runtime.
    Is there a reason for this request? There might be other solutions if a general problem was posed.

  • Call enhancement class method from Bus. workflow task

    Hi all,
    I recently enhanced a global class from SAP (add a new method). Now I would like to call it from a workflow task (ABAP Class object used in the task). So it seems that only "native" methods from the class itself can be selected for the object method of the task.
    Same issue if I try to call it via secondary methods options...
    Last idea I have before the repair is: retrieve the instance saved into the WF container via a custom class interfacing IF_IFS_SWF_CONTAINER_EXIT (program exit) and call the enhanced method from the method proposed in this interface.
    Maybe someone had the same issue? Anyone could help or propose solution?
    Many thanks in advance for your help,
    KR,
    Olivier

    I think it might qualify for an OSS message.
    There was simmilar note for BADIs which was corrected: https://service.sap.com/sap/support/notes/1156392
    CL_SWF_UTL_DEF_SERVICES which is used in PFTC to determine callable methods doesn't include enhancements when calling  function SEO_CLASS_TYPEINFO_GET (parameter WITH_ENHANCEMENTS is default FALSE)

  • Calling multiple DLL from Java and calling same native method

    i have two dll files named DLL_1.dll and DLL_2.dll .
    Both of them contain a native method which has a signature
    JNIEXPORT void JNICALL Java_Database_Notify
    (JNIEnv *, jclass);
    This method is common to both the DLL
    Now i load both of the DLL's using,
    System.loadLibrary("DLL_1");
    System.loadLibrary("DLL_2");
    Both of the DLL are loaded form same Java Application
    But the problem is that , whenever i try to call the Notify Method , it calls the Notify method of DLL_1 only.
    How do i call the Notify Methos of second DLL(i.e DLL_2).
    Is there any reference that i can get to all the DLL files when i load then , so that i can use that reference to invoke the Notify method of that particular DLL.

    i have two dll files named DLL_1.dll and DLL_2.dll .
    Both of them contain a native method which has a
    signature
    JNIEXPORT void JNICALL Java_Database_Notify
    (JNIEnv *, jclass);
    This method is common to both the DLL
    Now i load both of the DLL's using,
    System.loadLibrary("DLL_1");
    System.loadLibrary("DLL_2");
    Both of the DLL are loaded form same Java
    Application
    But the problem is that , whenever i try to call the
    Notify Method , it calls the Notify method of DLL_1
    only.
    How do i call the Notify Methos of second DLL(i.e
    DLL_2).
    Is there any reference that i can get to all the DLL
    files when i load then , so that i can use that
    reference to invoke the Notify method of that
    particular DLL.You need to explain exactly what you are trying to achieve.
    As per the description above it is impossible in java.
    And I didn't say JNI, I said java.
    Your above statement suggests that you think that you can have exactly the same java signature do two different things.
    Note again that I said java not JNI.
    A JNI method is just a tag that represents a java signature. Your description suggests that you are attempting to do it twice.
    There are three possibilities.
    1. Your explanation is incomplete.
    2. You are trying to do something that is impossible in java.
    3. You are trying to solve a problem and your description of your solution is not sufficient to determine what that is (and of course the solution is wrong.)

  • Are DLL methods called as instance or static methods from Java ?

    Hi,
    I have only a small question.
    When I call a C++ DLL method from Java using JNI, do I instantiate it like an object method or is it called as a static method ?
    I am asking you this because I will use servlets (Java 1.2.2) to call a DLL. These servlets may run concurrently in any moment, and I pass some data to this DLL. I want to know if there is any possibility of this data becoming corrupt, because of one concurrent servlet rewriting the data another servlet has passed.
    Thanks and regards.

    The question is not specific enough.
    Methods in C/C++ can be qualified with the following forms:
    -global (C/C++)
    -static member(C++ class method)
    -instance member(C++ class method)
    Since you didn't provide your code I couldn't possible determine which of the above you are using, but presumably you know.
    On the other hand a java native method is either static or non-static depending on how you defined it in the class. Once again without the code there is no way to say and presumably you already know this.
    The context of the methods is the same context that a similar servlet method has. But naturally in C/C++ is is easy to circumvent the context - for example by using a global variable.
    Data in C/C++ can always become corrupt and in the vast (all?) cases it is because something is wrong in the C/C++ code. Like a pointer that is not initialized, or a pointer used after it is free'd. Or writing past the end of a buffer, or writing before the beginning of a buffer.

Maybe you are looking for