HI!
Timothy Wall wrote:
You might check to verify that your objects are not being GC'd (JNA
native code prints to stderr if a callback has been GC'd, but in the
case of a service, that likely just goes nowhere). You can do this by
adding a printf to the object's finalize method, or creating a
WeakReference with an associated ReferenceQueue.
I'll check, but I already have a static reference to the callback
objects.
Yes, but if your class itself is GC'd, those static references will go
away. See if you can get a thread dump to see what the VM is doing.
You may need to spawn a sleeping thread whose sole function is to keep a
reference to your objects.
OK, I overwrote the finalize() method of the callback class and added
log output - it is never being called.
My class is not being GC'd, because I still get log messages after
ServiceStop from my main method. It just does not call the callback
method before, like it does with a C service.
Also, somehow I cannot attach to my Java class with jconsole, so I
cannot look inside.
Any other ideas? Shall I try to debug the JNA DLL?
Or maybe I can try to reroute stderr...
Thomas