- This topic has 4 replies, 3 voices, and was last updated 17 years, 5 months ago by ellipsis.
-
AuthorPosts
-
ellipsisParticipantCan anyone help me with the following problem:
I’m trying to generate a example web service with MyEclipse 5.1.1 GA using the default settings. This is my recipe:
– create new Web Service project with Myeclipse using the default settings named ExampleWebservice
– create new WSDL file using the default settings named ExampleWSDLFile.wsdl
– in the Web service Project, create new Web service from the above generated WSDL file using only the default settingsWhen I do a web deployment with Tomcat 5.5.9, I get the following error:
Anybody knows what can be wrong?SEVERE: Error initializing XFireServlet. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.xfire.spring.ServiceBean' defined in class path resource [META-INF/xfire/services.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.codehaus.xfire.service.ServiceFactory] for property 'serviceFactory'; nested exception is java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory ] PropertyAccessExceptionsException (1 errors) org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.codehaus.xfire.service.ServiceFactory] for property 'serviceFactory'; nested exception is java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory at org.codehaus.xfire.spring.editors.ServiceFactoryEditor.setAsText(ServiceFactoryEditor.java:40) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:771) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:584) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:469) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:626) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:653) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:642) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1023) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320) at org.codehaus.xfire.spring.XFireConfigLoader.getXFireApplicationContext(XFireConfigLoader.java:107) at org.codehaus.xfire.spring.XFireConfigLoader.loadContext(XFireConfigLoader.java:41) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.loadConfig(XFireConfigurableServlet.java:86) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.createXFire(XFireConfigurableServlet.java:54) at org.codehaus.xfire.transport.http.XFireServlet.init(XFireServlet.java:45) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) 20-jun-2007 11:20:33 org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /ExampleWebservice threw load() exception org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.xfire.spring.ServiceBean' defined in class path resource [META-INF/xfire/services.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.codehaus.xfire.service.ServiceFactory] for property 'serviceFactory'; nested exception is java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory ] PropertyAccessExceptionsException (1 errors) org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.codehaus.xfire.service.ServiceFactory] for property 'serviceFactory'; nested exception is java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory java.lang.IllegalArgumentException: Could not load service factory: org.codehaus.xfire.jaxb2.JaxbServiceFactory . Nested exception is java.lang.ClassNotFoundException: org.codehaus.xfire.jaxb2.JaxbServiceFactory at org.codehaus.xfire.spring.editors.ServiceFactoryEditor.setAsText(ServiceFactoryEditor.java:40) at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:771) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:584) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:469) at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:626) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:653) at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:642) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1023) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320) at org.codehaus.xfire.spring.XFireConfigLoader.getXFireApplicationContext(XFireConfigLoader.java:107) at org.codehaus.xfire.spring.XFireConfigLoader.loadContext(XFireConfigLoader.java:41) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.loadConfig(XFireConfigurableServlet.java:86) at org.codehaus.xfire.transport.http.XFireConfigurableServlet.createXFire(XFireConfigurableServlet.java:54) at org.codehaus.xfire.transport.http.XFireServlet.init(XFireServlet.java:45) at javax.servlet.GenericServlet.init(GenericServlet.java:211) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:894) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:857) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
This is the generated WSDL file:
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ExampleWSDLFile/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ExampleWSDLFile" targetNamespace="http://www.example.org/ExampleWSDLFile/"> <wsdl:types> <xsd:schema targetNamespace="http://www.example.org/ExampleWSDLFile/"> <xsd:element name="NewOperation"> <xsd:complexType> <xsd:sequence> <xsd:element name="in" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="NewOperationResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="out" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="NewOperationRequest"> <wsdl:part element="tns:NewOperation" name="parameters"/> </wsdl:message> <wsdl:message name="NewOperationResponse"> <wsdl:part element="tns:NewOperationResponse" name="parameters"/> </wsdl:message> <wsdl:portType name="ExampleWSDLFile"> <wsdl:operation name="NewOperation"> <wsdl:input message="tns:NewOperationRequest"/> <wsdl:output message="tns:NewOperationResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ExampleWSDLFileSOAP" type="tns:ExampleWSDLFile"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="NewOperation"> <soap:operation soapAction="http://www.example.org/ExampleWSDLFile/NewOperation"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ExampleWSDLFile"> <wsdl:port binding="tns:ExampleWSDLFileSOAP" name="ExampleWSDLFileSOAP"> <soap:address location="http://www.example.org/"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
Riyad KallaMemberCan you get the operation to work without trying to use Spring initially?
ellipsisParticipantI’m just using the code generated by MyEclipse without changing any setting. Only the Web Project name and the Web service name were changed.
How do I not use Spring initially?
Brian FernandesModeratorCan you paste your services.xml file here?
I notice you are using 5.1.1GA, which may have had a bug with some white space issues in services.xml.
Look at the serviceFactory element and make sure there is no white space in it.
e.g.<serviceFactory> factory </serviceFactory> - will not work <serviceFactory>factory</serviceFactory> - will work
Alternatively, you could move to 5.5.1GA which ships with a version of XFire (1.2.6) which does not have this issue.
Hope this helps.
ellipsisParticipantDear Brian,
Your suggestion fixed the problem. The generated code showed:
<serviceFactory> org.codehaus.xfire.jaxb2.JaxbServiceFactory </serviceFactory>
and the problem was solved by changing this to
<serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory</serviceFactory>
Thanx for your help!
-
AuthorPosts