• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple Jars Issue: SoapHeader.addHeaderElement(Name) Vs SoapHeader.addHeaderElement(Name)

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I am working on a spring-ws client to invoke a webservice using binary security token. I have all the code set-up and everything seems to be working fine except for one issue.

This spring-ws client will be deployed as part of an EAR on weblogic server. There are several third part jar files in the classpath including axis jars.

Now following line is my code is causing troubles :

where ctxElement is of type JAXBElement and header is of type javax.xml.soap.SOAPHeader;

Error: addHeaderElement(javax.xml.soap.Name) in javax.xml.soap.SOAPHeader cannot be applied to (javax.xml.namespace.QName)

I did some analysis and figured out the issue - javax.xml.soap.SOAPHeader class is available in both axis/saaj.jar and spring/jaxb-api2.1jar.
The version present in axis/saaj.jar only has following method
javax.xml.soap.SOAPHeader.addHeaderElement(Name)

The version present in spring/jaxb-api2.1jar only has both the following methods
javax.xml.soap.SOAPHeader.addHeaderElement(Name)
javax.xml.soap.SOAPHeader.addHeaderElement(QName)

Now do I solve this issue -

Should I just make sure spring/jaxb-api2.1jar appears before axis/saaj.jar in the classpath. Is that the correct way to address this issue in a production environment.
What are the alternate solutions?

Please help

 
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic