28 messages in net.java.dev.jna.usersRe: [jna-users] Win32 Service Callbacks
FromSent OnAttachments
Thomas BörkelAug 21, 2007 6:26 am 
Thomas BörkelAug 22, 2007 12:35 am 
Wayne MeissnerAug 22, 2007 4:38 pm 
Thomas BörkelAug 22, 2007 10:36 pm 
Timothy WallAug 31, 2007 7:23 am 
Thomas BörkelAug 31, 2007 7:47 am 
Timothy WallAug 31, 2007 7:55 am 
Thomas BörkelSep 3, 2007 6:29 am 
Thomas BörkelSep 3, 2007 1:11 pm 
Timothy WallSep 6, 2007 11:21 am 
Thomas BörkelSep 7, 2007 7:08 am 
Timothy WallSep 7, 2007 7:43 am 
Thomas BörkelSep 10, 2007 12:18 am 
Thomas BörkelSep 10, 2007 4:36 am 
Timothy WallSep 10, 2007 5:43 am 
Thomas BörkelSep 10, 2007 6:49 am 
Timothy WallSep 11, 2007 4:47 am 
Thomas BörkelSep 11, 2007 6:15 am 
Timothy WallSep 11, 2007 6:47 am 
Thomas BörkelSep 11, 2007 6:52 am 
Timothy WallSep 11, 2007 8:52 am 
Thomas BörkelSep 11, 2007 10:26 pm 
Timothy WallSep 12, 2007 5:45 am 
Thomas BörkelSep 12, 2007 5:56 am 
Timothy WallSep 12, 2007 6:19 am 
Thomas BörkelSep 12, 2007 7:09 am 
Timothy WallSep 12, 2007 8:17 am 
Thomas BörkelSep 13, 2007 12:58 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Win32 Service CallbacksActions...
From:Thomas Börkel (tho@boerkel.de)
Date:Sep 3, 2007 6:29:01 am
List:net.java.dev.jna.users

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