• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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

 
Dinner will be steamed monkey heads with a side of tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic