Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Spring Web Services does not seem to work with Castor 1.2 [SWS-287] #444
As brought up in the forum at http://forum.springframework.org/showthread.php?t=49583, it looks like as of Castor 1.2, castor has changed the way their XMLClassDescriptorResolver behaves that is incompatible with the way CastorMarshaller.java is using it.
While loading the spring config you'll get the following exception:
Caused by: java.lang.NullPointerException
I think spring-ws's CastorMarshaller may need to change to use Castor's XMLContext instead of the resolver directly and when creating castor's Marshaller/Unmarshaller. I was able to do this with local changes and it works fine, but that would probably break pre-1.2 Castor so the real framework change would likely involve a bit more.
Referenced from: commits f61e401
7 votes, 7 watchers
Jim Cummings commented
Arjen - here are the local changes I had made in case it is useful. This passes the spring-ws tests and worked for my problem at hand as well.
The supports() method clearly isn't as smart now. I'm hoping the various class loading scenarios would work with this, but I'm not confident since going with XMLContext seems to limit your control over the class loaders a bit.
Also, this does break pre-castor 1.2 as well.
Arjen Poutsma commented
After doing some research, I have come to the conclusion that it is impossible to support both Castor 1.1.1- and 1.1.2+ with the same marshaller. I tried various reflection tricks, but it seems impossible to differentiate between the different Castor versions. The fact that XMLContext was introduced in 1.1.2 doesn't really help here, since that means it's not a 1.1 vs. 1.2 differentiator.
So, I think the way forward is to support Castor 1.2+ only. It's really a shame that Castor broke the existing behavior with a minor version upgrade, thus forcing us into this.