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

Remove XML and image related body providers from core-common module #4293

Closed
tomas-langer opened this issue Oct 15, 2019 · 1 comment
Closed

Comments

@tomas-langer
Copy link
Contributor

Currently the class org.glassfish.jersey.message.internal.MessagingBinders$MessageBodyProviders contains the following providers (among others):

this.bindSingletonWorker(RenderedImageProvider.class);
((ClassBinding) this.bind(SourceProvider.StreamSourceReader.class).to(MessageBodyReader.class)).in(Singleton.class);
((ClassBinding) this.bind(SourceProvider.SaxSourceReader.class).to(MessageBodyReader.class)).in(Singleton.class);
((ClassBinding) this.bind(SourceProvider.DomSourceReader.class).to(MessageBodyReader.class)).in(Singleton.class);
((ClassBinding) this.bind(SourceProvider.SourceWriter.class).to(MessageBodyWriter.class)).in(Singleton.class);

The RenderedImageProvider depends on image rendering (and hence requires Linux with X installed.
The other providers are XML related (and drag the whole XML dependencies with them).

For normal JDK, this is not a major issue, as you have XML as part of the JDK and image processing would fail in runtime.
Already when using JPMS, we have a few required modules that may not be desired by an application.
When switching to ahead of time compilation using GraalVM (native-image), all of these dependencies MUST be part of the image - and as a result such image is quite big, and cannot be built in a docker container unless X is installed.

Please separate the registration of these providers to a different module, that can be excluded by the users.

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

2 participants