Hi list, I've been attempting to port my application from XFire to CXF. I have read the FAQs, the guides and googled about yet cannot seem to get on top of this error relating to how my service factory is configured. As per the docs it look like this:
<bean id="dataBinding" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype" /> <bean id="serviceFactory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="prototype"> <property name="dataBinding" ref="dataBinding" /> <property name="serviceConfigurations"> <list> <bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" /> <bean class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration" /> <bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration" /> </list> </property> </bean> >From what I can assertain this is correct, yet the scope="prototype" attribute on the serviceFactory configuration seems to cause so many issues. Take it away and the error goes away yet all my services follow the agentService configuration - which is clearly wrong. The service referenced in the (compacted) stacktrace below is configured like this: <jaxws:endpoint id="agentService" implementorClass="uk.co.company.app.ws.impl.AgentServiceImpl" implementor="#agentServiceImpl" address="/agentService"> <jaxws:serviceFactory> <ref bean="serviceFactory" /> </jaxws:serviceFactory> <jaxws:inInterceptors> <ref bean="agentAuthenticationHandler" /> </jaxws:inInterceptors> </jaxws:endpoint> Now, this looks utterly correct to me, yet I still get the stacktrace. The only fix I could come up with was to embed the service factory definition within the endpoint configuration. Given that I have a great many Web services this isn't really a viable option as it makes my context file so much bigger than it needs to be. I'm using CXF 2.0.5 with Spring 2.5.3 deployed under Resin. I had the same problem with the Spring 2.0 branch. Can anyone offer some advice as to how to continue? rgds, Richard org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceFactory' defined in file [C:\dev\eclipse\workspace\application\WebRoot\WEB-INF\applicationContext WebServices.xml]: Cannot create inner bean 'org.apache.cxf.jaxws.support.JaxWsServiceConfiguration#11671b2' of type [org.apache.cxf.jaxws.support.JaxWsServiceConfiguration] while setting bean property 'serviceConfigurations' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.support.JaxWsServiceConfiguration#11671b2' defined in file [C:\dev\eclipse\workspace\application\WebRoot\WEB-INF\applicationContext WebServices.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'serviceFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [org.apache.cxf.jaxws.JaxWsServerFactoryBean]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceFactory' defined in file [C:\dev\eclipse\workspace\application\WebRoot\WEB-INF\applicationContext WebServices.xml]: Cannot create inner bean 'org.apache.cxf.jaxws.support.JaxWsServiceConfiguration#11671b2' of type [org.apache.cxf.jaxws.support.JaxWsServiceConfiguration] while setting bean property 'serviceConfigurations' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.support.JaxWsServiceConfiguration#11671b2' defined in file [C:\dev\eclipse\workspace\application\WebRoot\WEB-INF\applicationContext WebServices.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'serviceFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxws.support.JaxWsServiceConfiguration#11671b2' defined in file [C:\dev\eclipse\workspace\application\WebRoot\WEB-INF\applicationContext WebServices.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'serviceFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'serviceFactory': Requested bean is currently in creation: Is there an unresolvable circular reference? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agentService': Unsatisfied dependency expressed through constructor argument with index 2 of type [org.apache.cxf.jaxws.JaxWsServerFactoryBean]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments? Richard Grantham Development ------------------------------- [EMAIL PROTECTED] Limehouse Software Ltd DDI: (020) 7566 3336 Main: (020) 7566 3320 Fax: (020) 7566 3321 Limehouse Software Ltd 4th Floor 1 London Bridge London SE1 9BG Manchester Office: 3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400 Check out Limehouse Software's innovative solutions www.limehousesoftware.co.uk - Transforming the way you publish and consult on information The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.