johvargas / sfdc-wsc

Automatically exported from code.google.com/p/sfdc-wsc
0 stars 0 forks source link

java.lang.ClassCastException: com.ibm.xml.xlxp2.jaxb.JAXBContextImpl incompatible with com.sun.xml.internal.bind.api.JAXBRIContext #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. trying to set the sessonheader in soap header jaxb context in  WEBSPHER 7 
for salesforce senddatatosfdc call using the below coce
2.
JAXBContext jaxbContext;
            try {
                // use the package you created your stub classes in
                jaxbContext = JAXBContext.newInstance("com.sforce.soap.schemas._class.sfdc_weblistener_service");
            } catch (JAXBException e) {
                throw new CssApplicationException(
                        CSSServiceConstants.SEND_DATA_TO_SFDC_SVC_REQ_EVENT_FAILED,CSSServiceConstants.SEND_DATA_TO_SFDC_SVC_REQ_EVENT_FAILED_REASON, null);
            }

            com.sforce.soap.schemas._class.sfdc_weblistener_service.SessionHeader sh = new com.sforce.soap.schemas._class.sfdc_weblistener_service.SessionHeader();
            sh.setSessionId(sessionHeader.getSessionId());
javax.xml.bind.JAXBContext javaxContext =  
javax.xml.bind.JAXBContext.newInstance("com.sforce.soap.schemas._class.sfdc_webl
istener_service");
            List<header> outheaders = new ArrayList<header>();        
    JAXBRIContext jaxbrcontext = (JAXBRIContext)javaxContext;
                        outheaders.add((header) Headers.create(jaxbrcontext, sessionHeader));
            WSBindingProvider wsBindingProvider = (WSBindingProvider) bp;
            wsBindingProvider.setOutboundHeaders(headers);
            wsBindingProvider.setOutboundHeaders(headers);
3.
it is not able to type caset the jaxb context into JAXBRIContext and it is 
throwing this exception.

java.lang.ClassCastException: com.ibm.xml.xlxp2.jaxb.JAXBContextImpl 
incompatible with com.sun.xml.internal.bind.api.JAXBRIContext

is there way to get rid of this type caste error or any alternative to set the 
sessionheader???

i am using websphere 7 and windows 7 os.

any help is much appriciated.

Thanks
srinivas

Original issue reported on code.google.com by dansr...@gmail.com on 17 May 2012 at 1:43

GoogleCodeExporter commented 8 years ago
I got the same problem...

Original comment by mat.manc...@gmail.com on 13 Jul 2012 at 10:18

GoogleCodeExporter commented 8 years ago
Above looks very interesting...

What does it have to do with the wsc tool?

Regards

Jesper Udby

Original comment by jesperudby on 2 Feb 2013 at 9:24

GoogleCodeExporter commented 8 years ago
Does not appear to be wsc related, closing

Original comment by jesperudby on 4 Feb 2013 at 2:53