I have a web service deployed in Xfire 1.2.6/Spring 2.0.4  (have
xfire-all.jar in classpath) in JDK 1.5 successfully, i.e. let xfire
generates WSDL and do the marshalling/unmarshalling. Here is the Spring
configuration:
      <bean id="abstractOrderEntryServiceWS"
class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="true">
            <property name="serviceFactory" ref="xfire.serviceFactory"/>
            <property name="xfire" ref="xfire"/>
      </bean>
      <bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="urlMap">
                  <map>
                        <entry key="/ApplicationService">
                              <ref bean="applicationServiceWS"/>
                        </entry>
                  </map>
            </property>
      </bean>
      <bean id="applicationServiceWS" parent="abstractOrderEntryServiceWS">
            <property name="serviceBean" ref="applicationService"/> <!--
service implementation -->
            <property name="serviceInterface" value="some service
interface"/> <!-- service interface class -->
      </bean>

Then I got org.codehaus.xfire.XFireRuntimeException: Cannot create mapping
for java.util.List after I changed for JiBX marshalling/unmarshalling with
static WSDL. Here is the Spring configuation:
      <bean id="jibxServiceFactory"
class="org.codehaus.xfire.jibx.JibxServiceFactory">
            <constructor-arg ref="xfire.transportManager"/>
      </bean>
      <bean id="abstractOrderEntryServiceWS"
class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="true">
            <property name="serviceFactory" ref="jibxServiceFactory"/> <!--
switch to JibxServiceFactory -->
            <property name="xfire" ref="xfire"/>
      </bean>
      <bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="urlMap">
                  <map>
                        <entry key="/ApplicationService">
                              <ref bean="applicationServiceWS"/>
                        </entry>
                  </map>
            </property>
      </bean>
      <bean id="applicationServiceWS" parent="abstractOrderEntryServiceWS">
            <property name="serviceBean" ref="applicationService"/> <!--
service implementation -->
            <property name="serviceInterface" value="some service
interface"/> <!-- service interface class -->
            <property name="wsdlURL"
value="classpath:wsdl/application.wsdl"/> <!-- use static WSDL -->
      </bean>


Here is the service method:
      public List<Product> getProducts(ServiceContext serviceContext,
ProductContext productContext);

The spring configuration (with JibxServiceFactory and static WSDL) works
fine if the service interface does not have java.util.List type (for
example the jibx sample comes with XFire download, modified). The Jibx
binding works fine in unit test.

Here is the exception stack trace. It seems it does not invoke
JibxTypeCreator though I dont know how you can inject it from Spring
configuration. I am just wondering maybe I missed something in Spring
configuration for JibxServiceFactory. Or maybe something else I am not
aware of.
org.codehaus.xfire.XFireRuntimeException: Cannot create mapping for
java.util.List, unspecified component type for return type of method
getProducts in interface
com.equifax.ems.sr.orderentry.application.ApplicationService
      at
org.codehaus.xfire.aegis.type.DefaultTypeCreator.createCollectionType(DefaultTypeCreator.java:43)
      at
org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:113)
      at
org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:356)
      at
org.codehaus.xfire.aegis.AegisBindingProvider.getSuggestedName(AegisBindingProvider.java:255)
      at
org.codehaus.xfire.service.binding.DefaultServiceConfiguration.getOutParameterName(DefaultServiceConfiguration.java:176)
      at
org.codehaus.xfire.service.binding.ObjectServiceFactory.getOutParameterName(ObjectServiceFactory.java:1078)
      at
org.codehaus.xfire.service.binding.ObjectServiceFactory.addOperation(ObjectServiceFactory.java:836)
      at
org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeOperations(ObjectServiceFactory.java:761)
      at
org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:444)
      at
org.codehaus.xfire.spring.ServiceBean.afterPropertiesSet(ServiceBean.java:176)
      at
org.codehaus.xfire.spring.remoting.XFireExporter.afterPropertiesSet(XFireExporter.java:30)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1175)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
      at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
      at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
      at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
      at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
      at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
      at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
      at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:314)
      at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:139)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1073)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:835)
      at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
      at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
      at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
      at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
      at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
      at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)
      at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)
      at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:329)
      at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:265)
      at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:235)
      at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
      at javax.servlet.GenericServlet.init(GenericServlet.java:261)

Thanks in advance.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to