com.sun.istack.SAXException2 : Instance … is substituting “java.lang.Object”, but … is bound to an anonymous type

前端 未结 3 2044
梦谈多话
梦谈多话 2021-01-18 03:41

I\'m upgrading a project to jaxb 2.2.7 from version 1.x.

I\'ve got the app working some of the time, but on some responses I see this:

java.lang.Runt         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 04:10

    I got the same exception when attempting to marshal some jaxb obejcts that I had generated from the hibernate-mapping-4.0.xsd

    The exceptions that were being thrown seemed to involve two classes that were generated as inner classes of the class HibernateMapping root class - "Id" and "CompositeID". Both of these elements were defined in the XSD as nested complexTypes, just as in @mdarwin's case. By moving the complexType definitions out (so that they were root elements of the "schema" element in the xsd) then the problem was resolved and the objects were successfully marshaled.

    A shame as I would have liked to have used the unmodified XSD to generate my jaxb object - but could not find another way around the problem.

提交回复
热议问题