Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8710429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:37:27+00:00 2026-06-13T04:37:27+00:00

I use Spring web services and Axis2 both in my app. They are completely

  • 0

I use Spring web services and Axis2 both in my app. They are completely independent and it works great, except that Spring WebServiceTemplate started throwing the exception below..

I suspect it’s happening because Spring requires saaj.jar (which has javax.xml.soap.SOAPElement) and Axis2 requires axiom-dom.jar (which has org.apache.axiom.om.impl.dom.ElementImpl)

Both the interfaces extend org.w3c.dom.Element and somehow Spring in picking up the one from axiom-dom.jar

Any ideas as to what i can do to prevent Spring from picking up the wrong implementation at runtime other than perhaps renaming axiom-dom.jar to z-axiom-dom.jar, so its later in the classpath?

com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.XWSSecurityException: java.lang.ClassCastException: org.apache.axiom.om.impl.dom.ElementImpl cannot be cast to javax.xml.soap.SOAPElement
at org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor.secureMessage(XwsSecurityInterceptor.java:139)
at org.springframework.ws.soap.security.AbstractWsSecurityInterceptor.handleRequest(AbstractWsSecurityInterceptor.java:179)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:542)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:341)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:37:28+00:00Added an answer on June 13, 2026 at 4:37 am

    This is not a conflict between saaj and axiom-dom, but a conflict between saaj and axis2-saaj.jar. axis2-saaj uses axiom-dom which is why the exception refers to Axiom. If you don’t use the JAX-WS implementation provided by Axis2, then you don’t need axis2-saaj, so depending on your use case, removing it may be a solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a web app that will use wicket, hibernate and spring
I'm developing a web application that use Spring Security for authentication of users. I
I am trying to use spring security in my application developing restful web services
Is there any way to use soap-rpc web services such that the client is
I'm working on a couple of web services that use JAXB bindings for the
I have 2 spring web apps that provide 2 separate set of services. Web
We use Spring dependency injection in a large web application. There are services which
I wish to use Spring MVC to provide a REST web service. However, running
I want to use two different Spring web contexts , each have own contextConfig,
I use Spring MVC (via Spring Roo) to build a small web application for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.