Link to home
Start Free TrialLog in
Avatar of kcquestions

asked on

JAX-WS javax.xml.bind.JAXBException in websrvice client (nor any of its super class is known to this context)

Hello Experts,
In RAD8, I've generated(with default settings) jax-ws(2.0 and 2.1) web service client uisng WSDL .
When i try to call using proxy calss I am getting following exception .

Caused by: javax.xml.bind.JAXBException: class com.siebel.xml.Input nor any of its super class is known to this context.

I did googled to find solution, some people are suggesting to change namespace and some people are suggesting to use cutom bindings, i am not clear about this.

I am struggling for this from yesterday, Can anyone help me to resolve this issue ?

Thanks in advance.
Avatar of girionis
Flag of Greece image

Do you have access to the source code? If yes try to add the XmlSeeAlso annotation:
Avatar of kcquestions


I've added @XmlSeeAlso in all com.siebel.xml.Input references, but still getting same error. Please let me know if you need more details.
Can you post the bit of code that throws this exception?
Its happend when i called below method in client proxy class.

public SpcImplementationOutput spcImplementation(SpcImplementationInput spcImplementationInput) {
        return _getDescriptor().getProxy().spcWSSpcImplementation(spcWSSpcImplementationInput);

Stack trace:Caused by: javax.xml.bind.JAXBException: class com.siebel.xml.SpcWSSpcImplementationInput nor any of its super class is known to this context.
      at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(
      at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(
      at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(
      at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(
      at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(
      at org.apache.axis2.datasource.jaxb.JAXBDSContext$
      at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshalByElement(
      at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshal(
      at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._outputFromBO(
      at org.apache.axis2.jaxws.message.impl.BlockImpl.outputTo(
      at org.apache.axis2.jaxws.message.impl.BlockImpl.serialize(
      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(
      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(
      at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(
      at org.apache.axis2.engine.AxisEngine.send(
      at org.apache.axis2.description.OutInAxisOperationClient.send(
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
      at org.apache.axis2.client.OperationClient.execute(
      at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(
Can you show me the bit of code that you create the spcWSSpcImplementationInput?
Thanks for troubleshooting this issue.

SpcImplementationInput spcWSSpcImplementationInput = new ObjectFactory().SpcWSSpcImplementationInput();

Also tried with new SpcWSSpcImplementationInput();

One thing i was missed to tell you.
I've added(on the top of class definition) @XmlSeeAlso in all com.siebel.xml.SpcImplementationInput references, but still getting same error. I am not sure is this correct or not.
public class ObjectFactory {

You will have to add this in your SpcImplementationInput class

public class SpcImplementationInput { 

Open in new window


public class SpcWSSpcImplementationInput { 

Open in new window

Try this and if this does not help then we can try marshalling and unmarshalling the object using JAXB.
Looks like its not worked.
I know marshalling and unmarshalling using JAXB (using .xsd files). But I am not sure how to do this for webservices (WSDL). Please point me ?
Hi, i am checking for some more options. This time i've generated JAX-WS classes in default packages (now claases are genarated in two packages), now i am getting below error. I didn't get any clue. Please advise ? Internal Error
      at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(
      at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(
      at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(
      at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(
      at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(
      at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(
      at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(
      at $Proxy245.spcWSSpcImplementation(Unknown Source)
      at com.siebel.xml.spcImplementationProxy.spcWSSpcImplementation(
Can you try the following?

SpcImplementationInput spcWSSpcImplementationInput = new ObjectFactory().SpcWSSpcImplementationInput();
String xml = <your jaxb marshaller>.marshall(spcWSSpcImplementationInput);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(new StringReader(xml)));
Element docElement = doc.getDocumentElement();

Open in new window

Then try to pass the docElement to the method.
Avatar of kcquestions

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried some options, above option works fine.