-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
JaxbProcessor should not register package-info to be bound to JaxbContext #27003
Comments
/cc @gsmet |
/cc @geoand |
Interesting. I'll have a look tomorrow |
Hm... I really know much of anything about XML, so we'll have to let @Sgitario comment on why the change above was made. |
My impression is that package-info's need not be bound to the JaxbContext explicitly, but during building the context they are automatically scanned for annotations if they are in the same package as one of the classes to be bound. |
Yeah, I agree, but my point is what the change was made explicitly for some reason which I am not privy to. So best to wait for @Sgitario |
That piece of code searchs for @XmlSchema annotation, that can be used only in package-info, so I think this was done for a reason and not incidentally. |
Yeah, that's my problem. I don't know why it was done unfortunately :( |
The intention was to register the JAXB annotations declared into the package info, not the package info java class itself. However, I don't see how your package info was added as part of the classes to be bounded into the JAXB Context. Can you share a reproducer so I could quickly look at? |
I have created a repository that reproduces both errors https://github.com/isarantidis/PackageInfoQuarkusError
|
The classes annotated with @XmlSchema within package-info results into errors because the package-info is not a class. These changes fix this issue by adding a package-info.java class and not bounding this class to the JAXBContext. Fix quarkusio#27003
Many thanks. I tried to build the reproducer and it was not failing for me. Anyway, I added a package-info.java in the extension and it was indeed failing. I've fixed it as part of this pull request: #27218 |
Apologies, apparently i forgot to mention i was testing the reproducer via launching the application and hitting the endpoint http://localhost:7070/account with a POST request, instead of having written a test. |
The classes annotated with @XmlSchema within package-info results into errors because the package-info is not a class. These changes fix this issue by adding a package-info.java class and not bounding this class to the JAXBContext. Fix quarkusio#27003 (cherry picked from commit 89499a7)
The classes annotated with @XmlSchema within package-info results into errors because the package-info is not a class. These changes fix this issue by adding a package-info.java class and not bounding this class to the JAXBContext. Fix quarkusio#27003
Describe the bug
Commit Allow to provide custom configuration for JAXB context , introduced changes to the JaxbProcessor. One of the changes results in the inclusion of package-infos to be bound to the JaxbContext
Expected behavior
No response
Actual behavior
Including camel's extensions via quarkus-camel-bom results in exceptions such as the following:
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 21 counts of IllegalAnnotationExceptions
org.apache.camel.model.errorhandler.package-info is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.apache.camel.model.errorhandler.package-info
org.apache.camel.model.config.package-info is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.apache.camel.model.config.package-info
Two classes have the same XML type name "{http://camel.apache.org/schema/spring}packageInfo". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at org.apache.camel.model.errorhandler.package-info
this problem is related to the following location:
at org.apache.camel.model.config.package-info
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "11.0.14" 2022-01-18 OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05) OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.11.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
No response
The text was updated successfully, but these errors were encountered: