My oxm.xml like this.
<?xml version="1.0" encoding="UTF-8"?>
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" xml-accessor-type="NONE" xml-mapping-metadata-complete="true" package-name="com.flexdms.flexims.model.generated">
<java-types>
<java-type name="TypedQuery">
<xml-root-element name="TypedQuery"/>
<java-attributes>
<xml-element java-attribute="id" name="id" xml-id="true"/>
<java-attribute java-attribute="Name" name="Name" required="true"/>
<java-attribute java-attribute="Type" name="Type" required="true"/>
</java-attributes>
</java-type>
<java-type name="ConditionQuery" super-type="TypedQuery">
<xml-root-element name="ConditionQuery"/>
<java-attributes/>
</java-type>
<java-type name="SingleInt">
<xml-root-element name="SingleInt"/>
<java-attributes>
<xml-element java-attribute="id" name="id" xml-id="true"/>
<java-attribute java-attribute="DateCreated" name="DateCreated" required="true"/>
<java-attribute java-attribute="DateModified" name="DateModified" required="true"/>
<java-attribute java-attribute="defaultCase" name="defaultCase"/>
<java-attribute java-attribute="withdefault" name="withdefault"/>
<java-attribute java-attribute="requiredAndAuto" name="requiredAndAuto" required="true"/>
<java-attribute java-attribute="AutoButNotRequired" name="AutoButNotRequired"/>
<java-attribute java-attribute="withminandmax" name="withminandmax"/>
<java-attribute java-attribute="allowedValue" name="allowedValue"/>
<java-attribute java-attribute="allowedWithDefault" name="allowedWithDefault"/>
</java-attributes>
</java-type>
</java-types>
</xml-bindings>
I got this exception
Local Exception Stack:
Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Name collision. Two classes have the XML type with uri and name typedQuery.
at org.eclipse.persistence.exceptions.JAXBException.nameCollision(JAXBException.java:215)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processTypeQName(AnnotationsProcessor.java:1783)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:812)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:738)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildNewTypeInfo(AnnotationsProcessor.java:4668)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postProcessXmlAccessorType(AnnotationsProcessor.java:1612)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:800)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:738)
at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:363)
at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:104)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext$MetadataContextInput.createContextState(DynamicJAXBContext.java:236)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:174)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.<init>(DynamicJAXBContext.java:71)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromOXM(DynamicJAXBContextFactory.java:347)
Actually, I am using code to generate XmlBindings. The xml shown above is dumped from XmlBindings java object.
My dynamicJaxbContext is created like this
Map<String, Object> properties = new HashMap<String, Object>(1);
properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, new MoxyMetaSource(types));
ServerSession session = JpaHelper.getEntityManagerFactory(em).getServerSession();
DynamicClassLoader dcl =DJPAHelper.getDcl(session);
jaxbContext =
DynamicJAXBContextFactory.createContextFromOXM(dcl, properties);
Here my DynamicType is created through DynamicJPA.
Did I do anything wrong with super-type? I do not see any name collision in my oxm.xml.
Thanks