Hello,

I have a strange error and don't know what could be a reason. Maybe 
someone has an idea.

i'm using spring 2.5.x, jboss 4.0.4, application is bundled as EAR and 
using CxfServlet and default cxf configuration.
 <value>classpath:META-INF/cxf/cxf.xml</value>
 <value>classpath:META-INF/cxf/cxf-extension-soap.xml</value>
 <value>classpath:META-INF/cxf/cxf-servlet.xml</value>

When service is invoked, its implementation is calling another webservice 
using client fetched using following code:
                        JaxWsProxyFactoryBean factory = new 
JaxWsProxyFactoryBean();
                        factory.setServiceClass(serviceInterface);
                        factory.setAddress(address);
                        factory.setWsdlLocation(wsdlLocation);
                        factory.setServiceName(QName.valueOf(serviceName
));
                        factory.setProperties(new HashMap<String, 
Object>());
                        factory.getProperties().put(
"schema-validation-enabled", new Boolean(schemaValidationEnabled));
                        T port = (T) factory.create();

It's working perfectly until i call this code again (even if with the same 
parameter values). After second and later initilialization i always ends 
with error:
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:218)&#xd;
Caused by: org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: 
Cannot find the declaration of element 'ns2:rbpMapService2Template'.&#xd;
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:208)&#xd;
        at 
org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:79)&#xd;
        at 
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:86)&#xd;
        at 
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)&#xd;
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)&#xd;
        at 
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)&#xd;
        at 
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)&#xd;
        at 
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)&#xd;
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:177)&#xd;
        ... 115 more&#xd;
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of 
element 'ns2:rbpMapService2Template'.]&#xd;
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)&#xd;
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)&#xd;
        at 
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)&#xd;
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:436)&#xd;
        at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:189)&#xd;
        ... 123 more&#xd;
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the 
declaration of element 'ns2:rbpMapService2Template'.&#xd;
        at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)&#xd;
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown 
Source)&#xd;
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)&#xd;
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
Source)&#xd;
        at 
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown 
Source)&#xd;
        at 
org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown 
Source)&#xd;
        at 
org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown 
Source)&#xd;
        at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown 
Source)&#xd;
        at 
com.sun.xml.bind.v2.runtime.output.SAXOutput.endStartTag(SAXOutput.java:124)&#xd;
        at 
com.sun.xml.bind.v2.runtime.output.ForkXmlOutput.endStartTag(ForkXmlOutput.java:102)&#xd;
        at 
com.sun.xml.bind.v2.runtime.XMLSerializer.endAttributes(XMLSerializer.java:302)&#xd;
        at 
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:680)&#xd;
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:151)&#xd;
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)&#xd;
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)&#xd;
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)&#xd;
        at 
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)&#xd;
        at 
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)&#xd;
        at 
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)&#xd;
        ... 127 more&#xd;

any idea why?

i tested the same process of creating client proxies for client of 
"wsdl_first" sample, and there it's working without problems (but of 
course, it's completly different setup)

best regards
jano

Reply via email to