openjdk and jni

Matthias info at o-notation.org
Mon Dec 19 14:57:37 UTC 2011


Hello group,
for a project i try to port the JNotify lib to FreeBSD. I use the 
kevents to get the file events; i put it in a jni-lib:
There is add-Method to register the event with path and 
eventmask(blocking mode), returning the filehandle. By registering the 
event i add a struct to kevent.udate for additional information(fh, 
mask, path).
A callback-method is called from jni-lib with values of the 
kevent.udata-struct, when a event is fired. That's the idea...
The Problem:
When i register different paths directly via the Java-Jni-Wrapper-Class, 
every event is fired and i get all the values of the callback-method.
When i register the same paths via the 
JNotify-wrapper-class->Java-Jni-Wrapper-Class, the events are fired too, 
but the values of the callback-method are totally wrong(not the values 
of the first registered event). All parameters showing nonsens.
Tests are showing, that the values of the struct returned by the kevent 
are already bad.

Are there any limitations of openjdk and jni? Why is it running fine 
when using the java-jni-class and using a wrapper-class the results are 
nonsens?

Any hints are welcome...

Matthias



More information about the freebsd-java mailing list