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

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

Meet an exception when unmarshalling from xml



        
14条回答
  •  庸人自扰
    2020-12-02 11:06

    This is a fix for a pretty niche use case but it gets me each time. If you are using the Eclipse Jaxb generator it creates a file called package-info.

    @javax.xml.bind.annotation.XmlSchema(namespace = "blah.xxx.com/em/feed/v2/CommonFeed")
    package xxx.blah.mh.domain.pl3xx.startstop;
    

    If you delete this file it will allow a more generic xml to be parsed. Give it a try!

提交回复
热议问题