|
Re: Moxy is not honoring "type" attribute in xml-element tag in EclipseLink 2.4.2 [message #1088205 is a reply to message #1086837] |
Fri, 16 August 2013 19:00 |
|
Hello,
This appears to be a bug. I have opened the following issue to track it:
- http://bugs.eclipse.org/415254
When I created an example based on your post:
- https://bugs.eclipse.org/bugs/attachment.cgi?id=234501
I get the following exception instead of the one you received:
Exception in thread "main" javax.xml.bind.JAXBException:
Exception Description: Class [] not found.
- with linked exception:
[Exception [EclipseLink-50047] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Class [] not found.]
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1001)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:169)
at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:165)
at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:152)
at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:112)
at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:385)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at entity.Demo.main(Demo.java:13)
Caused by: Exception [EclipseLink-50047] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Class [] not found.
at org.eclipse.persistence.exceptions.JAXBException.classNotFoundException(JAXBException.java:675)
at org.eclipse.persistence.jaxb.javamodel.reflection.JavaModelImpl.getClass(JavaModelImpl.java:91)
at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:180)
at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147)
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:997)
... 14 more
-Blaise
|
|
|
|
|
Re: Moxy is not honoring "type" attribute in xml-element tag in EclipseLink 2.4.2 [message #1096652 is a reply to message #1095862] |
Wed, 28 August 2013 17:30 |
|
As a workaround you could change your mapping metadata to look like the folllowing:
<?xml version="1.0"?>
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
package-name="entity">
<java-types>
<java-type name="Project" super-type="java.lang.Object"/>
<java-type name="ProjectSetting" super-type="java.lang.Object"/>
<java-type name="ProjectEO" xml-accessor-type="FIELD" super-type="java.lang.Object">
<xml-root-element />
<java-attributes>
<xml-element java-attribute="m_projectSettings" type="entity.ProjectSettingEO"
container-type="java.util.HashSet" xml-path="settings/ProjectSettingEO" />
</java-attributes>
</java-type>
<java-type name="ProjectSettingEO" xml-accessor-type="FIELD" super-type="java.lang.Object">
<xml-root-element />
<java-attributes>
<xml-transient java-attribute="_persistence_project_vh" />
<xml-inverse-reference java-attribute="m_project"
type="entity.ProjectEO" mapped-by="m_projectSettings" />
</java-attributes>
</java-type>
</java-types>
</xml-bindings>
|
|
|
Powered by
FUDForum. Page generated in 0.03290 seconds