I guess that would map to a C method called Java_ShowBondcrv1_aaBond_crv1_java, except 
that I'm not sure how the _ characters in the method name are handled. Looking at your 
earlier example, it might turn _ into _1, which would leave the C method as 
Java_ShowBondcrv1_aaBond_1crv1_1java, which is exactly what you said!

However, given that your DLL isn't exporting this method, I'm a bit stuck how it's 
working.

Is your simple app a Java app? Or is it a C app which uses JNI to go out to the Java 
and back to the C? It is possible (from the C side) to tell the JVM to override its 
normal mapping of Java names to C names.

So if your simple app is working, I suspect it is working in one of two ways:

1) It is a C application (.exe) which loads a JVM through the JNI Invokation API, and 
then explicitly tells the JVM to use the C aaBond_crv1 method when it encounters the 
particular Java native method, or

2) It's a Java application that first makes a call to a native initialisation method 
in the DLL which sets up the same mapping from Java method to C method which I've 
described above.

The JVM maps Java method names to C method names using the algorithm I've already 
described, or by being told explicitly what the mapping is for a given Java method. 
But this explicit mapping can only happen from C code (using a method called 
JNI_RegisterNatives, or something similar).

Anyway, this is really outside the scope of JBoss.

Things to try:

1) Is the sample app a native exe? If so, you might be stuck.
2) Is there a native init method that needs to be called?
3) Are you sure you're looking at the right DLL?
4) Are you sure JBoss is loading it? Try removing it and seeing if you get an 
exception. Try replacing it with a corrupt file (e.g. type a few words into Notepad, 
and save the file with a .DLL extension). This will prove that it's finding the file 
and trying to load it.
5) Are you sure you're calling System.loadLibrary before you're calling the native 
method?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3839871#3839871

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3839871


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to