Community
Participate
Working Groups
The following NPE is thrown if an invalid XmlJavaTypeAdapter is specified in the external metadata: Caused by: java.lang.NullPointerException at org.eclipse.persistence.jaxb.compiler.Property.setAdapterClass(Property.java:132) at org.eclipse.persistence.jaxb.compiler.Property.setXmlJavaTypeAdapter(Property.java:518) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXmlElement(XMLProcessor.java:700) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processJavaAttribute(XMLProcessor.java:350) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processJavaType(XMLProcessor.java:328) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:278) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:141) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:244) ... 37 more ie. <?xml version="1.0"?> <xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"> <java-types> <java-type name="org.example.customer.PurchaseOrder"> <java-attributes> <xml-element java-attribute="customer" > <xml-java-type-adapter value="org.example.customer.metadata.InvalidCustomerAdapter"/> </xml-element> </java-attributes> </java-type> </java-types> </xml-bindings>
Created attachment 172783 [details] Core - Fix
Created attachment 172784 [details] MOXy - Fix
Created attachment 172950 [details] Core - Fix
Created attachment 172951 [details] MOXy - Fix
Created attachment 173022 [details] MOXy - Test Cases
Fix checked into 2.1.1 at rev: 7717 Fix checked into trunk at rev: 7718 Code reviewed by David McCann Log messages like the following are now reported: [EL Warning]: 2010-06-28 16:37:34.057--An invalid XmlJavaTypeAdapter [invalid.class.name.1] was specified for package [org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.negative], and will be ignored. [EL Warning]: 2010-06-28 16:37:34.057--An invalid XmlJavaTypeAdapter [invalid.class.name.2] was specified for class [org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.negative.Customer], and will be ignored. [EL Warning]: 2010-06-28 16:37:34.073--An invalid XmlJavaTypeAdapter [invalid.class.name.3] was specified for field/property [id] on class [org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.negative.Customer], and will be ignored.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink