Moxy and enums [message #1836991] |
Wed, 20 January 2021 16:17 |
Robert Schulk Messages: 146 Registered: July 2015 |
Senior Member |
|
|
I am using a similar setup to what is described in this example:
https://github.com/vogellacompany/eclipsercp-jaxb-java11
With moxy, I am trying to unmarshal jaxb xmls.
This works all fine for simple XMLs which only have one class as generated source.
If I try to unmarshal a more complex xml, I get the following exception.
Does anybody know what could be wrong with my setup?
JAXBContext jbContext = JAXBContext.newInstance(MyTest.class.getPackageName(), MyTest.class.getClassLoader());
java.lang.NoClassDefFoundError: org/eclipse/persistence/internal/libraries/asm/ClassWriter
at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateWrapperClass(MappingsGenerator.java:3280)
at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateWrapperClassAndDescriptor(MappingsGenerator.java:3090)
at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.addEnumerationWrapperAndDescriptor(MappingsGenerator.java:3061)
at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.processGlobalElements(MappingsGenerator.java:3008)
at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateProject(MappingsGenerator.java:283)
at org.eclipse.persistence.jaxb.compiler.Generator.generateProject(Generator.java:191)
at org.eclipse.persistence.jaxb.JAXBContext$ContextPathInput.createContextState(JAXBContext.java:1002)
at org.eclipse.persistence.jaxb.JAXBContext$ContextPathInput.createContextState(JAXBContext.java:995)
at org.eclipse.persistence.jaxb.JAXBContext$ContextPathInput.createContextState(JAXBContext.java:922)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:205)
at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:127)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:248)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)
<<<my code from above>>>
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.internal.libraries.asm.ClassWriter cannot be found by org.eclipse.persistence.moxy_2.7.7.v20200504-69f2c2b80d
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 61 more
[Updated on: Thu, 21 January 2021 08:20] Report message to a moderator
|
|
|
Re: Setup for Moxy in RCP application [message #1837020 is a reply to message #1836991] |
Thu, 21 January 2021 07:03 |
Robert Schulk Messages: 146 Registered: July 2015 |
Senior Member |
|
|
Could this be a bug in moxy?
I can reproduce this error whenever both applies:
* I include moxy via p2 provisioning
* I have enums in the schema.
Minimum example:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="MoxyTest">
<xs:complexType>
<xs:sequence>
<xs:element name="Elems" type="myEnumA" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="myEnumA">
<xs:restriction base="xs:string">
<xs:enumeration value="A" />
<xs:enumeration value="B" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
[Updated on: Thu, 21 January 2021 08:21] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04521 seconds