users@jax-rpc.java.net

JWSDP/S1Studio5: ServiceLifecycle.init() never invoked ?!?

From: Gero Vermaas <Gero.Vermaas_at_Sun.COM>
Date: Thu, 17 Jul 2003 10:27:15 +0200

Hi,

I received a question from a customer with regard to the javax.xml.rpc.server.ServiceLifecycle interface. The customer is using SunOneStudio 5 and SunOneAppServer 7 to gain experience with webservice developement.

They implemented the javax.xml.rpc.server.ServiceLifecycle interface, generated a (web-centric) webservice and test client using SunOneStudio 5, and deployed it on SunOneAppserver 7. The problem now is that the init() method that they've implemented for the ServiceLifecycle never get's invoked. The strange thing is that the destroy() method (also of ServiceLifecycle) does get invoked when they invoke the webservice :-(

I tried the same thing and ran into the same problem. Reading the API doc at http://java.sun.com/webservices/docs/1.2/api/javax/xml/rpc/server/ServiceLifecycle.html suggests that both init() and destroy() should be invoked. I also deployed the thing to the internal Tomcat server of SunOneStudio5 and then even the destroy() method was not invoked anymore.

I've zipped up the small test project, you can download it at: http://www.xs4all.nl/~gero/servicelifecycleproblem.zip

The class for which a webservice is generated is attached: TestjeImpl.java.

When the WebService is invoked, it porduces the following in the server.log file of SunOneAppServer:
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: ------------------------------
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: Test webservice constructor
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: ------------------------------
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: do echo for value 1234
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: ------------------------------
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: Test webservice is destroyed!
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: beenThere: false
[15/Jul/2003:15:22:43] INFO (32005): CORE3282: stdout: ------------------------------

Any idea why the destroy() method does get invoked and the init() not?

Regards,

Gero