[SWS-822] NoSuchMethodError after upgrading to AXIOM 1.2.14 Created: 10/Jan/13  Updated: 04/Apr/13  Resolved: 04/Apr/13

Status: Resolved
Project: Spring Web Services
Component/s: None
Affects Version/s: 2.1.2
Fix Version/s: 2.1.3

Type: Bug Priority: Minor
Reporter: Mark Diskin Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File SWS-822-part2.patch     Text File SWS-822.patch    

 Description   

SEVERE: Servlet.service() for servlet [ws] in context with path [/settleinv] threw exception [Request processing failed; nested exception is java.lang.NoSuchMethodError: org.apache.axiom.soap.SOAPFactory.createSOAPMessage(Lorg/apache/axiom/om/OMXMLParserWrapper;)Lorg/apache/axiom/soap/SOAPMessage;] with root cause
java.lang.NoSuchMethodError: org.apache.axiom.soap.SOAPFactory.createSOAPMessage(Lorg/apache/axiom/om/OMXMLParserWrapper;)Lorg/apache/axiom/soap/SOAPMessage;
	at org.springframework.ws.soap.axiom.AxiomSoapMessage.<init>(AxiomSoapMessage.java:99)
	at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.createWebServiceMessage(AxiomSoapMessageFactory.java:189)
	at org.springframework.ws.soap.axiom.AxiomSoapMessageFactory.createWebServiceMessage(AxiomSoapMessageFactory.java:81)

I attempted to add the compat additional JAR but that did not fix the problem looks like that Factory Method no longer takes an argument see https://issues.apache.org/jira/browse/AXIOM-412.

http://ws.apache.org/axiom/userguide/ch04.html#changes-1.2.14



 Comments   
Comment by Andreas Veithen [ 10/Jan/13 ]

The issue is also described here:

https://issues.apache.org/jira/browse/AXIOM-444

I'm currently working on a fix in Axiom to restore compatibility, but the code in Spring-WS should definitely be changed because the method it attempts to use is considered an internal method.

Comment by Andreas Veithen [ 10/Jan/13 ]

Attached a patch for this issue.

Comment by Andreas Veithen [ 10/Jan/13 ]

While working on the fix for Axiom, I discovered another potential issue (although I didn't see any test failures). The problem is that Spring-WS instantiates the SOAP factories (SOAP11Factory and SOAP12Factory) directly, while the recommended approach is to use OMAbstractFactory to locate the (singleton) factories. However, there is some code in Axiom that makes the assumption that factories are singletons, so this may cause problems.

It should also be noted that SOAP11Factory and SOAP12Factory are part of axiom-impl, but application code is expected to only use classes from axiom-api (and in Maven projects, axiom-impl should be a dependency with scope runtime).

I'll try to provide a patch for this issue as well.

Comment by Andreas Veithen [ 10/Jan/13 ]

Attached a patch for the SOAP factory issue.

Comment by Arjen Poutsma [ 04/Apr/13 ]

Fixed! Thanks for the patches.

Generated at Tue Dec 12 17:59:32 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.