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

Jaxb2Marshaller.createJaxbContext() doesn't respect provided classloader when checking JAXB version

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.8
    • Component/s: OXM
    • Labels:
      None

      Description

      Jaxb2Marshaller.createJaxbContext() checks the JAXB version using JaxbUtils

      if (JaxbUtils.getJaxbVersion() < JaxbUtils.JAXB_2)

      { throw new IllegalStateException( "Cannot use Jaxb2Marshaller in combination with JAXB 1.0. Use Jaxb1Marshaller instead."); }

      But this is incorrect because JaxbUtils is checking the version by seeing if it can load javax.xml.bind.Binder using the ClassUtils' getDefaultClassLoader. Instead it should use the supplied classloader set via setBeanClassLoader in Jaxb2Marshaller.

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              miguel Miguel Vargas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 5m
                5m