JAXB doesn't unmarshall after updating java from 1.8.0_77 to 1.8.0_121

后端 未结 4 568
遇见更好的自我
遇见更好的自我 2021-01-06 05:42

Yesterday I updated java like posted in the title, now JAXB doesn\'t parse xml anymore. All objects are simply null, nothing seems to be set.

Given this POJO - List

4条回答
  •  难免孤独
    2021-01-06 06:22

    I faced this issue of unmarshelling giving null values in jdk 101+ versions and solved by including package-info.java and annotation @javax.xml.bind.annotation.XmlSchema

    Below is my code

    @javax.xml.bind.annotation.XmlSchema(elementFormDefault=XmlNsForm.QUALIFIED,namespace="http://example.com/api") package org.example;

    import javax.xml.bind.annotation.XmlNsForm;
    

提交回复
热议问题