Community
Participate
Working Groups
JAXBException logged when anyattribute is used for sub type of Map using external metadata instead of using annotations. javax.xml.bind.JAXBException: Exception Description: XmlAnyAttribute is invalid on property others. Must be used with a property of type Map. - with linked exception: [Exception [EclipseLink-50004] (Eclipse Persistence Services - 2.4.0.qualifier): org.eclipse.persistence.exceptions.JAXBException Exception Description: XmlAnyAttribute is invalid on property others. Must be used with a property of type Map.] at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextSta te(JAXBContext.java:900) at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:180) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFacto ry.java:146) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFacto ry.java:133) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFacto ry.java:93) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFacto ry.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.xml.bind.ContextFinder.newInstance(Unknown Source) at javax.xml.bind.ContextFinder.find(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at examples.demo.ELBug361578.main(ELBug361578.java:34) Caused by: Exception [EclipseLink-50004] (Eclipse Persistence Services - 2.4.0.qualifier): org.eclipse.persistence.exceptions.JAXBException Exception Description: XmlAnyAttribute is invalid on property others. Must be used with a property of type Map. at org.eclipse.persistence.exceptions.JAXBException.anyAttributeOnNonMap(JAXBExce ption.java:161) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXmlAnyAttribute(XMLP rocessor.java:629) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processJavaAttribute(XMLPro cessor.java:513) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processJavaType(XMLProcesso r.java:474) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.jav a:362) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:145) at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextSta te(JAXBContext.java:896) ... 13 more
Created attachment 209294 [details] Standalone Reproducer
Created attachment 209295 [details] Proposed Fix including testcase.
Reviewed and checked into trunk.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink