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

后端 未结 8 1274
再見小時候
再見小時候 2021-02-02 08:11

I am trying to create a sample test application which converts an object to JaxbRepresentation. But when I try to run this, it gives me an error.

Main.java file

8条回答
  •  孤街浪徒
    2021-02-02 09:05

    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

提交回复
热议问题