Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Moxy and enums(Potential bug for enum usage in moxy p2 provisioning)
Moxy and enums [message #1836991] Wed, 20 January 2021 16:17 Go to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 118
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 Go to previous messageGo to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 118
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

Re: Moxy and enums [message #1837275 is a reply to message #1836991] Tue, 26 January 2021 21:26 Go to previous messageGo to next message
Lukas JungmannFriend
Messages: 34
Registered: November 2013
Location: Prague, Czech Republic
Member
Quote:
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.internal.libraries.asm.ClassWriter

says what's wrong - that class is available in org.eclipse.persistence.asm.jar, ie this one: https://search.maven.org/artifact/org.eclipse.persistence/org.eclipse.persistence.asm/2.7.8/jar
Re: Moxy and enums [message #1837509 is a reply to message #1837275] Mon, 01 February 2021 11:26 Go to previous message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 118
Registered: July 2015
Senior Member
I did include this plugin, of course. I can access the class manually in my code.
But what I see now: the p2 update site gives me version 7.3.1. Could that be the problem?
Previous Topic:EclipseLink DataModifyQuery does not throw fatal exception
Next Topic:secure password and user name in persistence.xml
Goto Forum:
  


Current Time: Sat Jun 12 21:45:25 GMT 2021

Powered by FUDForum. Page generated in 0.01296 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top