aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Anyone have any experience with JNIWrapper? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Anyone have any experience with JNIWrapper?" Watch "Anyone have any experience with JNIWrapper?" New topic
Author

Anyone have any experience with JNIWrapper?

C. C.
Greenhorn

Joined: Sep 12, 2005
Posts: 1
Hello,

I am currently doing research for a JNI project and was wondering if anyone had any experience using JNIWrapper. So far, I have downloaded and purchased a developer license and have been trying to implement a callback (C->Java). It seems to work fine, with the exception of a glaring memory exception (something along the lines of "Exception 80000003, at 0006F890 Native function stack data: 0,49504165,6c6c6f50,0" ) as soon as the callback finishes in C and returns to Java.

This only happens when I pass a pointer to a C struct (implemented in Java with JNIWrapper's Pointer) as a parameter of the callback. This is after I have initialized all fields inside the Pointer (just a single Int type) using init(). The Pointer is initialized with the size of the struct by passing the class it points to as it's constructor argument. Am I not allocating memory properly, or does JNIWrapper not handle the Pointer type very well?

I have contacted support at JNIWrapper, but their time difference (GMT+2?) makes it difficult to communicate with them. We have passed our code back and forth a few times, but it is very slow. Any help would be appreciated, since the project is quite time-critical. Thanks in advance.
[ September 12, 2005: Message edited by: C. C. ]
Vitaly Shelest
Greenhorn

Joined: Sep 28, 2005
Posts: 4
This is a very strange approach to call JNI SDK from java code. Why do not write the native code in C++? The only problem is that JNI SDK is not friendly and very difficult in use. This problem can be solved in the way other then JNIWrapper. For four years I have been developing Object Oriented JNI SDK and Add-In for Microsoft VC++ 7.1. This tool generates C++ JNI class wrapplers for java classes selected (in bytecode format). JNI programming become Object Oriented, all JNI specifics are generated and wrapped.
The demo version of OOJNI Add-In for MS VC++ 7.1 is available at
http://shareware.pcmag.com/product.php[id]90910[SiteID]pcmag
http://simtel.net/product.php[id]90910[SiteID]simtel.net
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anyone have any experience with JNIWrapper?
 
Similar Threads
is there a sizeof() in Java?
jni help
JNI: Wrapping an Existing C Library-Best Practices?
new to Java; Help Needed in networking ; packet structure equivalent in java
I'm looking for JNI real world examples