4

I'm trying to use MOXY with Spring Boot. To that end I included the following in my Gradle build file:

org.eclipse.persistence:org.eclipse.persistence.moxy:2.7.1

And added a jaxb.properties file with:

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory

within a JAXB annotated classes directory. However, the context still is:

JAXB context: class com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl

Any ideas on the problem/solution? Thanks.

Ari
  • 4,121
  • 8
  • 40
  • 56

2 Answers2

1

I actually used the solution provided here: https://stackoverflow.com/a/13254722/364244 The META-INF folder in Spring Boot should be in the resources directory, full path is src/main/resources/META-INF/services/javax.xml.bind.JAXBContext.

dArignac
  • 1,205
  • 4
  • 11
  • 25
0

I faced same issue and fixed by check jaxb.properties file's location.

When you create new JAXBContext, ContextFinder will find property files with ClassLoader by its expected propFileName.

If ClassLoader cannot find any property files, then internal.bind.v2.runtime.JAXBContextImpl will be used.

So please check your contextPath and your property files location.

In my case, directory name and hierarchy structure was wrong.