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

Cause exception is lost for IllegalAnnotationsException #1803

Open
PavelTurk opened this issue Jun 14, 2024 · 1 comment
Open

Cause exception is lost for IllegalAnnotationsException #1803

PavelTurk opened this issue Jun 14, 2024 · 1 comment

Comments

@PavelTurk
Copy link

This is what I have in log file:

org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:83) ~[jaxb-runtime-4.0.2.jar:?]
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:421) ~[jaxb-runtime-4.0.2.jar:?]
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:255) ~[jaxb-runtime-4.0.2.jar:?]
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1115) ~[jaxb-runtime-4.0.2.jar:?]
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.ContextFactory.createContext(ContextFactory.java:144) ~[jaxb-runtime-4.0.2.jar:?]
	at org.glassfish.jaxb.runtime@4.0.2/org.glassfish.jaxb.runtime.v2.JAXBContextFactory.createContext(JAXBContextFactory.java:44) ~[jaxb-runtime-4.0.2.jar:?]
	at jakarta.xml.bind@4.0.0/jakarta.xml.bind.ContextFinder.find(ContextFinder.java:368) ~[jakarta.xml.bind-api-4.0.0.jar:?]
	at jakarta.xml.bind@4.0.0/jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:605) ~[jakarta.xml.bind-api-4.0.0.jar:?]
	at jakarta.xml.bind@4.0.0/jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:546) ~[jakarta.xml.bind-api-4.0.0.jar:?]

However, it gives me nothing. So, I have to add breakpoint to line 81 of IllegalAnnotationsException and check list field, to understand what is going on:
Screenshot from 2024-06-14 12-02-48

@PavelTurk
Copy link
Author

I find out how to get causes in log with slf4j but it was very unexpected. I think this behaviour should be changed:

       try {
            JAXBContext context = JAXBContext.newInstance(settingsClass);
            Unmarshaller unmarshaller = context.createUnmarshaller();
            ....
        } catch (JAXBException e) {
            logger.error("Error reading settings from {}: {}", path, e.toString(), e); //NOTE e.toString()
        } 

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