Skip to content

Jaxb2Marshaller.createJaxbContext() doesn't respect provided classloader when checking JAXB version [SWS-550] #674

@gregturn

Description

@gregturn

Miguel Vargas opened SWS-550 and commented

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.


Affects: 1.5.7

Referenced from: commits 376d07f

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions