Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-287

Spring Web Services does not seem to work with Castor 1.2

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.5.1
    • Component/s: OXM
    • Labels:
      None

      Description

      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
      at org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl.setMappingLoader(XMLClassDescriptorResolverImpl.java:143)
      at org.springframework.oxm.castor.CastorMarshaller.createClassDescriptorResolver(CastorMarshaller.java:325)
      ...

      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.

        Issue Links

          Activity

          jim Jim Cummings created issue -
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Could you please supply the local changes you made as a patch? Thanks.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Could you please supply the local changes you made as a patch? Thanks.
          arjen.poutsma Arjen Poutsma made changes -
          Field Original Value New Value
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Hide
          jim Jim Cummings added a comment -

          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.

          Show
          jim Jim Cummings added a comment - 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.
          jim Jim Cummings made changes -
          Attachment castor1.2_patch.txt [ 13657 ]
          Hide
          fbascheper Erik-Berndt Scheper added a comment -

          I've verified that the supplied patch works fine for me, too.

          Show
          fbascheper Erik-Berndt Scheper added a comment - I've verified that the supplied patch works fine for me, too.
          Hide
          jang jang added a comment -

          I had the same problem and this patch works good.
          Will it be implemented in Spring web services 1.5 ?????

          Show
          jang jang added a comment - I had the same problem and this patch works good. Will it be implemented in Spring web services 1.5 ?????
          arjen.poutsma Arjen Poutsma made changes -
          Fix Version/s 1.5 RC1 [ 10652 ]
          arjen.poutsma Arjen Poutsma made changes -
          Fix Version/s 1.5.1 [ 10917 ]
          Fix Version/s 1.5 RC1 [ 10652 ]
          Hide
          fbascheper Erik-Berndt Scheper added a comment -

          See SWS-309 for another improvement on the CastorMarshaller class.

          Show
          fbascheper Erik-Berndt Scheper added a comment - See SWS-309 for another improvement on the CastorMarshaller class.
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is depended on by SWS-309 [ SWS-309 ]
          arjen.poutsma Arjen Poutsma made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          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.

          Show
          arjen.poutsma Arjen Poutsma added a comment - 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.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Resolved, though this means that the CastorMarshaller only works with 1.2+.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Resolved, though this means that the CastorMarshaller only works with 1.2+.
          arjen.poutsma Arjen Poutsma made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Hide
          wguttmn Werner Guttmann added a comment -

          Arjen, being a committer of Castor, I'd like to know what the issue is ?

          Show
          wguttmn Werner Guttmann added a comment - Arjen, being a committer of Castor, I'd like to know what the issue is ?
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing issues for 1.5.1

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing issues for 1.5.1
          arjen.poutsma Arjen Poutsma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          ejvyas Vyas Sanzgiri added a comment -

          I am still experiencing the same issue with 1.5.2 and castor 1.2. Is this fixed?

          Show
          ejvyas Vyas Sanzgiri added a comment - I am still experiencing the same issue with 1.5.2 and castor 1.2. Is this fixed?
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          75d 4h 56m 1 Arjen Poutsma 01/May/08 9:22 PM
          In Progress In Progress Resolved Resolved
          12h 55m 1 Arjen Poutsma 02/May/08 10:18 AM
          Resolved Resolved Closed Closed
          3d 11h 2m 1 Arjen Poutsma 05/May/08 9:20 PM

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              jim Jim Cummings
            • Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: