cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaun Montgomery (JIRA)" <>
Subject [jira] [Created] (CXF-4626) JAXB Marshalling error class not known to this context
Date Fri, 09 Nov 2012 18:02:12 GMT
Shaun Montgomery created CXF-4626:

             Summary: JAXB Marshalling error class not known to this context
                 Key: CXF-4626
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.5.4
         Environment: Windows 7, Netbeans 7.1.2, 
            Reporter: Shaun Montgomery

I am trying to update a web service client and change it from using pregenerated classes using
wsdl2java to dynamically loading the wsdl and creating the client.  The application needs
to dynamically load the request and response structures and uses java reflection to display
the contents of the response.  I use the following code to create the dynamic client:

            JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
loading wsdl from " + theWsdlLocation);
            ClassLoader clBefore = Thread.currentThread().getContextClassLoader();
            dynClient = dcf.createClient(theWsdlLocation, bindingFileList);
            if (dynClient == null) {
creation not successful");
            } else {
creation of service client from wsdl at " + theWsdlLocation);
            Bus bus = ((EndpointImpl) dynClient.getEndpoint()).getBus();   
            PolicyInterceptorProviderRegistry pipr = bus.getExtension(PolicyInterceptorProviderRegistry.class);
            pipr.register(new XRMAuthPolicyProvider());
            http = (HTTPConduit) dynClient.getConduit();
// ************************            
            HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();

I then use the following code to invoke the read method on the service:

            Class asrReqClass = Class.forName("");
            Object asrReq = asrReqClass.newInstance();
            EntityKeyList ekl = CreateEntityKeyList(keys);
            Method setEntityKeyListMethod = asrReq.getClass().getMethod("setEntityKeyList",
            setEntityKeyListMethod.invoke(asrReq, ekl);
            Object [] asrRespObjs = dynClient.invoke("read", asrReq);

I have also tried to use the context loader to load the asrReq class.
If I add code to create a JAXBContext, I am able to marshall the asrReq class correctly.

The Exception I am getting is:

Nov 9, 2012 9:58:06 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Interceptor for {}AddressService#{}read
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error:
is not known to this context
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(

I would really appreciate some help with this.  I've already spent too much time trying to
figure it out and a solution is critical.

Thanks in advance.


This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message