JaxbRepresentation gives error “doesnt contain ObjectFactory.class or jaxb.index”

In my case I was able to resolve this by adding a file called “jaxb.index” in the same package folder as the JAXB annotated class. In that file list the simple, non-qualified names of the annotated classes.

For example, my file /MyProject/src/main/java/com/example/services/types/jaxb.index is simply one line (since I have only one JAXB typed class):

ServerDiagContent

which refers to the class com.example.services.types.ServerDiagContent

Leave a Comment