javax.xml.bind.UnmarshalException: unexpected element (uri:“”, local:“Group”)

前端 未结 14 1140
终归单人心
终归单人心 2020-12-02 10:13
unexpected element (uri:\"\", local:\"Group\"). Expected elements are <{}group>

Meet an exception when unmarshalling from xml



        
14条回答
  •  -上瘾入骨i
    2020-12-02 10:51

    I had the same issue. I added following attributes to elementFormDefault="qualified" attributeFormDefault="unqualified"

    
    

    and re-generated java classes by running xjc, which corrected package-info.java.

    @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.example.com/schemas/ArrayOfMarketWithStations", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
    

    This fixed the issue for me.

提交回复
热议问题