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

[FEATURE REQ] Allow customising the XmlFactory passed in JacksonAdapter for Azure Storage #22764

Closed
2 tasks
timja opened this issue Jul 3, 2021 · 6 comments
Closed
2 tasks
Assignees
Labels
Azure.Core azure-core customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@timja
Copy link
Contributor

timja commented Jul 3, 2021

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

In an application where the current Threads context class loader is not the main class loader I am unable to load the required stax implementation required by jackson-xml-databind. The one bundled in the JDK is incompatible.

In normal situations I would pass by expected classloader down to whatever is doing the classloading, unfortunately jackson-databind-xml doesn't expose a method for that although the JDK does, jackson-constructor

It does provide constructors for an already configured XmlFactory, if I could pass that to the JacksonAdapter in some way then that would solve my problem, (would be passed to the builder instead of it creating one) https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/JacksonAdapter.java#L137

Describe the solution you'd like
A supported API for providing either my classloader for loading the XMLInputFactory or providing a precreated XmlFactory

Describe alternatives you've considered

Additional context
Add any other context or screenshots about the feature request here.

jenkinsci/jackson2-api-plugin#82 (comment)
jenkinsci/azure-storage-plugin#194
jenkinsci/azure-storage-plugin#188

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 3, 2021
@timja
Copy link
Contributor Author

timja commented Jul 4, 2021

This has been worked around upstream in FasterXML/jackson-dataformat-xml#482.

Having said that the maintainer of jackson of jackson said:

downstream frameworks may want to explicitly construct and pass XMLInputFactory and XMLOutputFactory, going forward. That won't solve all issues but may help avoid one error mode.

That would allow a consistent implementation being used (Woodstox or Aalto), instead of our case now with the JDK implementation being picked up.

FasterXML/jackson-dataformat-xml#480 (comment)

Any thoughts?

@rickle-msft
Copy link
Contributor

@alzimmermsft This sounds like a policy that should be standardized across sdks. Any thoughts on if this is something that can go through the arch board?

@timja
Copy link
Contributor Author

timja commented Jul 5, 2021

Further discussion in FasterXML/jackson-dataformat-xml#483, which likely means no change is required here, although that doesn't prevent the Azure SDK from explicitly configuring the correct stax implementation.

@JonathanGiles JonathanGiles added Azure.Core azure-core and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 5, 2021
@alzimmermsft
Copy link
Member

@timja is this issue still a problem? I see that Jackson ended up making a change with how this is loaded, did that solve your problem?

@timja
Copy link
Contributor Author

timja commented Sep 1, 2022

For my purpose it works, but it’s recommended to allow users to configure the classloader themselves

Copy link

Hi @timja, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core azure-core customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants