[
http://jira.codehaus.org/browse/XFIRE-875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_104347
]
Bartosz Kowalewski commented on XFIRE-875:
------------------------------------------
It turned out that the solution described above is not enough. When I run the
whole service with a huge WSDL definition, the exception is still thrown , but
for a different element. I may be wrong, but I think that there's a little bug
in the JaxbWSDLBuilder (created in the JaxbWSDLBuilderFactory).
JAXB schema generator tends to put additional namespace declarations on the
element/type level, that is not on the top (schema) level. Unfortunately (I
don't know why ... and I don't want to know :) ) in one of the schemas
generated for my service JAXB declares namespace on the schema level.
JaxbWSDLBuilder does not copy those additional declarations when generating the
final WSDL definition.
Unfortunately I do use xfire source release (I do not use XFire source
repository), so I cannot provide a patch, but I'll provide a snipplet to show
what's wrong (what I think is wrong). (I use 1.2.6 source release).
Method generateJaxbSchemas()
OLD:
Element previousSchema = createSchemaType(namespace);
while (schema.getContentSize() > 0) {
Content child = schema.removeContent(0);
previousSchema.addContent(child);
}
No additional namespace declarations are copied from the old (jaxb-generated)
schema, to the new previousSchema.
Should be sth similar to:
Element previousSchema = createSchemaType(namespace);
for (Iterator itr = schema.getAdditionalNamespaces().iterator();
itr.hasNext();) {
previousSchema.addNamespaceDeclaration((Namespace) itr.next());
}
while (schema.getContentSize() > 0) {
Content child = schema.removeContent(0);
previousSchema.addContent(child);
}
> 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