[
http://jira.codehaus.org/browse/XFIRE-875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103898
]
Bartosz Kowalewski commented on XFIRE-875:
------------------------------------------
I think I can provide a solution for this issue. I've studied XFire's source
code and it seems that this minor change could help.
The approach to using XFire in my project was totally different than the one
described above. I don't use Spring, I don't even use XFire build-in servlets.
My project:
- A bunch of xsd and wsdl files are used to generate (wsgen) Java files (JAXB).
- All of the services are deployed dynamically from my servlet.
- I was using a client based on the XFireProxyFactory class and everything
worked fine, when a JAXWS client was implemented, I got this error:
java.lang.IllegalStateException: Could not initialize Service.
at
org.codehaus.xfire.jaxws.ServiceDelegate.<init>(ServiceDelegate.java:77)
at
org.codehaus.xfire.jaxws.Provider.createServiceDelegate(Provider.java:32)
at javax.xml.ws.Service.<init>(Unknown Source)
at
edu.agh.csg.wsnpsi.wsn.client.jaxws.NotificationBrokerClientStub.<init>(NotificationBrokerClientStub.java:79)
at
edu.agh.csg.wsnpsi.wsn.client.jaxws.NotificationBrokerClientStub.createServiceStub(NotificationBrokerClientStub.java:58)
at
edu.agh.csg.wsnpsi.wsn.client.jaxws.sample.SampleApp.main(SampleApp.java:38)
Caused by: org.codehaus.xfire.XFireRuntimeException: Couldn't find schema part:
{http://docs.oasis-open.org/wsn/b-2}Notify
at
org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.isWrapped(WSDLServiceBuilder.java:572)
at
org.codehaus.xfire.wsdl11.parser.WSDLServiceConfigurator.setWrapped(WSDLServiceConfigurator.java:143)
at
org.codehaus.xfire.wsdl11.parser.WSDLServiceConfigurator.<init>(WSDLServiceConfigurator.java:83)
at
org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:243)
at
org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:193)
at
org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:434)
at
org.codehaus.xfire.jaxws.ServiceDelegate.getService(ServiceDelegate.java:88)
at
org.codehaus.xfire.jaxws.ServiceDelegate.<init>(ServiceDelegate.java:70)
... 5 more
Old version of my code (works fine):
1) XFireProxyFactory-based client:
ObjectServiceFactory factory = new AnnotationServiceFactory(
new Jsr181WebAnnotations(),
getXFire().getTransportManager(),
new AegisBindingProvider(new
JaxbTypeRegistry()));
// create(Class, String, String, Map)
org.codehaus.xfire.service.Service serviceModel = factory.create(SERVICE_CLASS,
NAME, GlobalConstants.NAMESPACE, null);
this.service = (NotificationBroker) new
XFireProxyFactory().create(serviceModel, SERVICE_ADDRESS);
2) servlet:
identical factory initialization
---------------------------------------------------
My JAX-WS client is extremely similar to those generated by wsgen. It does not
work with services deployed by my servlet, throws IllegalStateException
exception listed above.
---------------------------------------------------
I analyzed the XFire JAX-WS implementation and it turned out the the (Class,
QName, URL, Map) version of create is used. My old XFireProxyFactory-based
client won't work with this version of create. Both the client- and
servlet-side lack one single line - setting a WsdlBuilderFactory on the
ObjectServiceFactory instance ('factory.setWsdlBuilderFactory(new
JaxbWSDLBuilderFactory());').
** With this line added to servlet the JAX-WS client works fine! ** Also my
XFireProxyFactory-based client works ok.
The configuration of the context in the application provided by Chris and the
underlying XFire source code suggest that a bare instance of
org.codehaus.xfire.jaxws.JAXWSServiceFactory is used, no builders are set. A
minor modification of the server side of this application will probably help.
> XFire can't find schema when xsd:import is used
> -----------------------------------------------
>
> Key: XFIRE-875
> URL: http://jira.codehaus.org/browse/XFIRE-875
> Project: XFire
> Issue Type: Bug
> Affects Versions: 1.2.3, 1.2.4
> Reporter: Chris Moesel
> Assignee: Dan Diephouse
> Attachments: xfire-calc-service.zip
>
>
> If my types are defined in an external .xsd document, and I import them into
> the WSDL using xsd:import tag (or xsd:include), I get the following error:
> 09:23:27 ERROR ContextLoader - Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'calculatorWebService' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
> exception is org.codehaus.xfire.XFireRuntimeException: Couldn't find schema
> part: {http://example.com/calculator/types}simpleAddition
> Caused by:
> org.codehaus.xfire.XFireRuntimeException: Couldn't find schema part:
> {http://example.com/calculator/types}simpleAddition
> at
> org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.isWrapped(WSDLServiceBuilder.java:554)
> at
> org.codehaus.xfire.wsdl11.parser.WSDLServiceConfigurator.setWrapped(WSDLServiceConfigurator.java:143)
> at
> org.codehaus.xfire.wsdl11.parser.WSDLServiceConfigurator.<init>(WSDLServiceConfigurator.java:83)
> at
> org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:225)
> at
> org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:181)
> at
> org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:410)
> at
> org.codehaus.xfire.spring.ServiceBean.afterPropertiesSet(ServiceBean.java:172)
> at
> org.codehaus.xfire.spring.remoting.XFireExporter.afterPropertiesSet(XFireExporter.java:30)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
> at
> org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
> at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
> 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.deployWAR(HostConfig.java:809)
> at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
> at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
> at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
> at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
> 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:709)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
> 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:294)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
> I am doing contract-first development with jax-ws and jaxb 2.0. I am also
> using Spring 2.0.1.
> A zip file is attached. In order to work, please copy xfire-all and
> dependencies into WEB-INF/lib (and be sure to use Spring 2.0 instead of
> Spring 1.2.6). The 'dist' ANT task will create a deployable WAR.
> Link to the discussion on the xfire-users mailing list:
> http://www.nabble.com/RE%3A-XFireRuntimeException%3A-Couldn%27t-find-schema-for-part%3A-...-tf3162134.html#a8775459
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email