Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum type not unmarshalled correctly #2169

Open
alerosmile opened this issue Jun 12, 2024 · 0 comments
Open

Enum type not unmarshalled correctly #2169

alerosmile opened this issue Jun 12, 2024 · 0 comments

Comments

@alerosmile
Copy link

Describe the bug
Reading the XML file from the attached sample does not work correctly. The value of the enum attribute is always null. This is because the attribute value cannot be converted to an enum. This is the internal exception message:

Exception [EclipseLink-3001] (Eclipse Persistence Services - 4.0.3.v202405220658): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [VALUE2], of class [class java.lang.String], could not be converted to [class com.jaxb.test.TestEnum].

The value cannot be converted because the converter does not exist. And that in turn is because the TestEnum class is not read correctly during creation of the JAXBContext. The internals of the creation of the JAXBContext is rather hard to understand but it seems that it is missing nested types.

Should the @XmlSeeAlso lookup be recursive? Or should properties be processed in org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processReferencedClass(JavaClass) even if the type is isPostBuilt? I have no clue but that's where it misses the enum type in my case.

To Reproduce
I've include a simple maven project to reproduce the issue.
schema-test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant