This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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 Interview Guide this week in the Jobs Discussion 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

Anyone have any experience with JNIWrapper?

C. C.

Joined: Sep 12, 2005
Posts: 1

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

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[id]90910[SiteID]pcmag[id]90910[SiteID]
I agree. Here's the link:
subject: Anyone have any experience with JNIWrapper?
It's not a secret anymore!