Name collision when using super-type in moxy oxm.xml [message #1104289] |
Sun, 08 September 2013 01:08  |
Eclipse User |
|
|
|
my oxm.xml
<?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>
The exception I got
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)
at com.flexdms.flexims.test.unit.query.TestMoxy.setJaxbContext(TestMoxy.java:58)
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);
The dynamicClassLoader is from DynamicJPA. The class loader is already has all the dynamicTypes. My XmlBinding is created from java code. The oxm.xml shown above is the dump of java object. I do not see any name collision in my oxm.xml. Did I do something wrong with super-type?
thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09032 seconds