I need to use
onApplicationEnd() as part of
Application.cfc to execute a call on a 3rd party Java object to close a connection to another device on the network.
The code I have worked perfectly if I call it as a normal request, but when I place it in the
onApplicationEnd() method I'm running into some errors. These errors suggest that CF might in fact be shutting down already to the point where I cannot access these 3rd party Java classes. Not good, but also unexpected.
I then decided I'd create a parallel thread in the
onApplicationEnd() and then rejoin to the main thread when I had closed by connection, but I get an obscure null pointer exception trying to create this thread from this function. Again, the same code works well if I use it in a normal request.
Is there restrictions to what I can do in
onApplicationEnd() and if so is there any work around?
I am using CF 8 (8,0,1,195765) Developer Edition on a Windows XP machine.
Many thanks in advance!