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)
Caused by: org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1:
Cannot find the declaration of element 'ns2:rbpMapService2Template'.
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:208)
at
org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:79)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:86)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:177)
... 115 more
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
element 'ns2:rbpMapService2Template'.]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:436)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:189)
... 123 more
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'ns2:rbpMapService2Template'.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
at
org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
at
org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown
Source)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
com.sun.xml.bind.v2.runtime.output.SAXOutput.endStartTag(SAXOutput.java:124)
at
com.sun.xml.bind.v2.runtime.output.ForkXmlOutput.endStartTag(ForkXmlOutput.java:102)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.endAttributes(XMLSerializer.java:302)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:680)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:151)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
... 127 more
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