[ 
https://issues.apache.org/activemq/browse/SM-1398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Freeman Fang resolved SM-1398.
------------------------------

    Resolution: Fixed

paste conversation from the mailing list

Hi,

Right, I reproduce your problem when I disable my network connection.
I think I find the reason, the proxy you used for cxf se CalculatorExt.java has 
a input para as type AddRequest.java, and AddRequest.java has a field 
javax.xml.ws.wsaddressing.W3CEndpointReference, when build servicemix model 
from the proxy SEI, it will try to build schema from the 
javax.xml.ws.wsaddressing.W3CEndpointReference, which as you see get exception 
when your machine has no network access.
To avoid this, you can use the 
org.apache.cxf.ws.addressing.EndpointReferenceType shipped with cxf,  using
./wsdl2java -noAddressBinding calculatorExt.wsdl
can generate org.apache.cxf.ws.addressing.EndpointReferenceType instead of 
javax.xml.ws.wsaddressing.W3CEndpointReference for your auto-generated stuff.
You also need replace org.apache.cxf.ws.addressing.EndpointReferenceType with 
javax.xml.ws.wsaddressing.W3CEndpointReference in your impl class of cxfse su.

Regards
Freeman


Fullocto wrote:
> Hi freeman,
>
> I spent my day trying to debug/understand
> And well I may have a clue, I think that it works on your computer that has
> internet!
>
> Mine has not accessed to internet...
> The Xsd I import is the ws-addressing one, it is read by schemabuilder, and
> I don't know when exactly (trying to figure it out), I think it may
> recognize some "special" namespaces.
> The point is that the schemaLocation (used in
> schemabuilder.resolvexmlschema) becomes automatically
> http://www.w3.org/2006/03/addressing/ws-addr.xsd, I launched a browser on an
> online computer, and there is the XSD!
> It should only point to my ws-addr local file :/ 

> CXF proxy and complex wsdl: XMLSCHEMAEXCEPTION: www.w3.org
> ----------------------------------------------------------
>
>                 Key: SM-1398
>                 URL: https://issues.apache.org/activemq/browse/SM-1398
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-cxf-bc, servicemix-cxf-se
>            Reporter: Brice
>            Assignee: Freeman Fang
>         Attachments: 20080613-calculatrice-CXFproxyError-src.rar, 
> calculator-cxf-sa-3.3-SNAPSHOT.zip
>
>
> Hi all,
> I want to instantiate a CXF SE endpoint that uses a proxy. This proxy is 
> configured in my CXF SE xbean and the target service is deployed by a CXF BC.
> The problem may be the wsdl exposed by the BC is complex (XSD included 
> imports other XSD)
> The error happens during the spring "instantiation?", is throwed through 
> CxfSeProxyFactoryBean and ends in 
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema: with a 
> XMLSchemaException: www.w3.org
> I join the configuration files and the trace
> TY for your help
> Brice
> <b>here are my configuration files</b>
> CXFSE bean.xml:
>    <cxfse:endpoint>
>         <cxfse:pojo>
>           <bean class="myenterprise.com.mycxf.endpointImpl">   
>               <property name="proxyInterface1Temp">
>              <cxfse:proxy service="out:externalService" 
> interfaceName="out:externalServiceInterface1PortType" context="#context" 
> type="myenterprise.com.out.interface" />
>              </property>
>           </bean>                    
>         </cxfse:pojo>
>     </cxfse:endpoint>
> <cxfbc:provider wsdl="classpath:myWSDL.wsdl"
>                       interfaceName="out:externalServiceInterface1PortType"
>                       service="out:externalService"
>                       endpoint="externalServiceRegistrationPort"
>                       locationURI="http://localhost:8080/server/";
>                       />
>    <cxfbc:provider wsdl="classpath:myWSDL.wsdl"
>                       interfaceName="out:externalServiceInterface2PortType"
>                       service="out:externalService"
>                       endpoint="externalServicePublisherPort"
>                       locationURI="http://localhost:8080/server/";
>                       />
>                       
>    <cxfbc:provider wsdl="classpath:myWSDL.wsdl"
>                       interfaceName="out:externalServiceInterface3PortType"
>                       service="out:externalService"
>                       endpoint="externalServiceSubscriberPort"
>                       locationURI="http://localhost:8080/server/";
> My wsdl file includes an XSDthat itself imports other XSD
> <b>here is the error</b>
> <loc-message>Error creating bean with name 
> 'org.apache.servicemix.cxfse.CxfSeEndpoint' defined in file [C:\Ser
> viceMix\3.3\data\smx\service-assemblies\architectureTest-cxf-sa\version_8\sus\servicemix-cxf-se\architectureTest-cxfse-System-su\xbean.xml]:
>  Cannot create inner bean
> 'myenterprise.com.mycxf.endpointImpl' of type 
> [myenterprise.com.mycxf.endpointImpl] while setting bean property 'pojo'; 
> nested exception is org.springframework.beans.factory.BeanCr
> eationException: Error creating bean with name 
> 'myenterprise.com.mycxf.endpointImpl' defin
> ed in file 
> [C:\ServiceMix\3.3\data\smx\service-assemblies\architectureTest-cxf-sa\version_8\sus\servicemix-cxf-se\architectureTest-cxfse-System-su\xbean.xml]:
>  Cannot
> create inner bean 'cxfse:proxy#adfaec' of type 
> [org.apache.servicemix.cxfse.CxfSeProxyFactoryBean] while setting bean 
> property 'proxyInterface1Temp'; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'cxfse:proxy#adfaec': FactoryBean threw except
> ion on object creation; nested exception is java.lang.RuntimeException: 
> org.apache.ws.commons.schema.XmlSchemaException: www.w3.org</loc-message>
>                                         
> Caused by: org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'cxfse:proxy#adfaec': FactoryBean threw exception on
>  object creation; nested exception is java.lang.RuntimeException: 
> org.apache.ws.commons.schema.XmlSchemaException: www.w3.org
> Caused by: java.lang.RuntimeException: 
> org.apache.ws.commons.schema.XmlSchemaException: www.w3.org
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1886)
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1902)
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1627)
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:175)
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:82)
>         at 
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:359)
>         at 
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:353)
>         at 
> org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:121)
>         at 
> org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:93)
>         at 
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:345)
>         at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:343)
>         at 
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:513)
>         at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:394)
>         at 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:180)
>         at 
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
>         at 
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:79)
>         at 
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
>         at 
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:97)
>         at 
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:89)
>         at 
> org.apache.servicemix.cxfse.CxfSeProxyFactoryBean.createProxy(CxfSeProxyFactoryBean.java:96)
>         at 
> org.apache.servicemix.cxfse.CxfSeProxyFactoryBean.getObject(CxfSeProxyFactoryBean.java:73)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1236)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1207)
>         at 
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
>         at 
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:10
> 99)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
>         at 
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:215)
>         at 
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:10
> 99)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
>         at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
>         at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
>         at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
>         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:287)
>         at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
>         at 
> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:89)
>         at 
> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
>         at 
> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
>         at 
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)
>         at java.util.TimerThread.mainLoop(Timer.java:512)
>         at java.util.TimerThread.run(Timer.java:462)
> Caused by: org.apache.ws.commons.schema.XmlSchemaException: www.w3.org
>         at 
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:308)
>         at 
> org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1884)
>         ... 49 more
> ]]></stack-trace>
>                                 </msg-loc-info>
>                         </exception-info>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> </jbi-task-result>
> </jbi-task>
>         at 
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)
>         at 
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)
>         at 
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:543)
>         at 
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
>         ... 6 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to