I created a simple web service to test how the constructor for the
implementation class gets called on start-up of my app server with this
service deployed. I'm using CXF 2.5.2 and JBoss 6.0.
I have several questions.
1 Is it a good practice to design a service relying on the constructor of
the implementation class getting called?
2 Why, as can be seen from part of my JBoss log file below, is my
constructor being called twice? Is this a CXF problem or a JBoss problem?
(BTW, I will be asking the same question on the JBoss forum).
21:28:21,190 INFO [XmlBeanDefinitionReader] Loading XML bean definitions
from resource loaded through InputStream
21:28:21,252 INFO [STDOUT] ***********************************
21:28:21,252 INFO [STDOUT] ***** Test Constructor Called *****
21:28:21,252 INFO [STDOUT] ***********************************
21:28:21,252 INFO [GenericApplicationContext] Refreshing
org.springframework.context.support.GenericApplicationContext@582c8ca7:
startup date [Tue Feb 28 21:28:21 EST 2012]; parent:
org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusApplicationContext@16
3fa023
21:28:21,252 INFO [DefaultListableBeanFactory] Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@13695cf
: defining beans [weather]; parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@faf73d2
21:28:21,377 INFO [ReflectionServiceFactoryBean] Creating Service
{http://dev.test/}Test from WSDL: /wsdl/test.wsdl
21:28:22,110 INFO [ServerImpl] Setting the server's publish address to be
http://localhost:9090/Test/testws
21:28:22,219 WARN [JaxwsEndpointDefinitionParser$JBossWSSpringEndpointImpl]
WSDLPublisher not configured, unable to publish contract!
21:28:22,235 INFO [XmlBeanDefinitionReader] Loading XML bean definitions
from resource loaded through InputStream
21:28:22,266 INFO [STDOUT] ***********************************
21:28:22,266 INFO [STDOUT] ***** Test Constructor Called *****
21:28:22,266 INFO [STDOUT] ***********************************
21:28:22,266 INFO [GenericApplicationContext] Refreshing
org.springframework.context.support.GenericApplicationContext@1650b3cd:
startup date [Tue Feb 28 21:28:22 EST 2012]; parent:
org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusApplicationContext@16
3fa023
21:28:22,266 INFO [DefaultListableBeanFactory] Pre-instantiating singletons
in
org.springframework.beans.factory.support.DefaultListableBeanFactory@844e7f8
: defining beans [Test]; parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@faf73d2
21:28:22,282 INFO [ReflectionServiceFactoryBean] Creating Service
{http://dev.test/}Test from WSDL: //WEB-INF/wsdl/test.wsdl
21:28:30,612 INFO [AddressRewritingEndpointInfo] Setting new service
endpoint address in wsdl: http://localhost:9090/Test/testws
21:28:30,612 INFO [AddressRewritingEndpointInfo] Setting new service
endpoint address in wsdl: http://localhost:8080/Test/Test/testws
21:28:30,628 INFO [ServerImpl] Setting the server's publish address to be
http://localhost:8080/Test/Test/testws
21:28:30,706 INFO [WSDLFilePublisher] WSDL published to:
file:/C:/Programs/jboss-
6.0.0.Final/server/default/data/wsdl/Test.war/test.wsdl
21:28:30,737 INFO [DefaultEndpointRegistry] register:
jboss.ws:context=Test,endpoint=Test
21:28:30,768 INFO [TomcatDeployment] deploy, ctxPath=/Test
21:28:30,799 INFO [AbstractCXFServlet] Servlet transport factory already
registered
21:28:30,831 INFO [service] Removing bootstrap log handlers
21:29:09,519 INFO [service] Restored bootstrap log handlers
21:29:09,519 INFO [TomcatDeployment] undeploy, ctxPath=/Test
21:29:09,550 INFO [DefaultEndpointRegistry] remove:
jboss.ws:context=Test,endpoint=Test