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

Target_org_apache_cxf_common_spi_NamespaceClassGenerator loads classes that are not registered for reflection #518

Closed
ppalaga opened this issue Aug 25, 2022 · 2 comments · Fixed by #530
Assignees
Milestone

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Aug 25, 2022

Target_org_apache_cxf_common_spi_NamespaceClassGenerator tries to load several classes such as
org.apache.cxf.jaxb.EclipseNamespaceMapper
org.apache.cxf.jaxb.NamespaceMapper
org.apache.cxf.jaxb.NamespaceMapperRI
org.apache.cxf.common.jaxb.NamespaceMapper

out of which only org.apache.cxf.jaxb.NamespaceMapper is registered for reflection and thus only that execution path will ever be executed.

I wonder which of the following is the right solution:

A. Register all named classes

B. Register all subclasses of com.sun.xml.bind.marshaller.NamespacePrefixMapper - we need to check whether this catches all the named classes

C. Change Target_org_apache_cxf_common_spi_NamespaceClassGenerator to always return org.apache.cxf.jaxb.NamespaceMapper

The bottom line is that I have never seen the Could not create a NamespaceMapper compatible with Marshaller class ... message even though I removed the org.apache.cxf.jaxb.NamespaceMapper registration. I wonder what kind of test would hit the substituted method?

@shumonsharif
Copy link
Contributor

Hi @ppalaga In cases like this, I have generally followed what seems like the 'safest' approach to minimize any potential issues. I couldn't find any unit tests in the CXF codebase that deal with org.apache.cxf.jaxb.NamespaceMapper ... my suggestion would be to either do option A, or even better, remove the substitution all together given you couldn't even hit the method.

We likely have quite a bit of leftover experimental code from the initial days of this extension, that could possibly be cleaned up ... this seems to fall into that category.

@ppalaga
Copy link
Contributor Author

ppalaga commented Aug 29, 2022

Oh, indeed, removing Target_org_apache_cxf_common_spi_NamespaceClassGenerator would be the most elegant solution :) Let's try it!

@ppalaga ppalaga self-assigned this Sep 7, 2022
ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Sep 7, 2022
ppalaga added a commit that referenced this issue Sep 7, 2022
@ppalaga ppalaga added this to the 1.6.0 milestone Sep 7, 2022
@ppalaga ppalaga modified the milestones: 1.6.0, 1.5.1 Nov 30, 2022
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

Successfully merging a pull request may close this issue.

2 participants