NullPointerException in saxon IdentityTransformer.transform when extracting data from javax DOMSource

StackOverflow https://stackoverflow.com/questions/12910541

  •  07-07-2021
  •  | 
  •  

문제

I am using Spring Webservice (2.1.0) Client to send a very simple Message to a Soap UI Mock Webservice. (Hello World style, no namespaces)

Before Sending the DOMSource via the SpringWebserviceTemplate it is extracted from a jdom2.Element as jdom2.transform.JDOMSource. (JDOM 2.0.2)

The Transformer is Saxon 9.4.0.4.

While calling the Spring Webservice Template function sendSourceAndReceiveToResult the net.sf.saxon.IdentityTransformer throws a NullPointerException when executing the transform(DOMSource,responseResult) function.

Since DOMSource is available at that point I do not know what could have gone wrong.

Stacktrace tells me the Nullpointer was thrown at: net.sf.saxon.lib.SerializerFactory.getReceiver (line 239).

It would help me greatly if you could speculate on possible causes.

도움이 되었습니까?

해결책

Please note that the best way of reporting a Saxon problem is to use either the Saxon forums at http://saxonica.plan.io, or the saxon-help mailing list on SourceForge. We try to monitor questions on StackOverflow, but it's often a few days before we notice them.

With this kind of problem, the cause is often that some piece of software (like Spring Webservice) is using the JAXP TransformerFactory mechanism to load whatever XSLT transformer it finds on the classpath, but hasn't actually done the testing to ensure that it works with an arbitrary XSLT transformer; people often test only with the default one provided by the JDK. It's not clear from your question whether you actually intended for it to use Saxon or not.

Line 239 of SerializerFactory is actually doing

throw new IllegalArgumentException("Unknown type of result: " + result.getClass());

(having tested whether result is one of the kinds of Result that it recognizes); so it looks to me as if result (which is probably the value passed to the transform() method) is null. Check the contents of your responseResult value.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top