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

RestTemplate (and probably server side as well) should be able to bootstrap itself if* is not available [SPR-17007] #21545

spring-projects-issues opened this issue Jul 4, 2018 · 1 comment
in: web type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Jul 4, 2018

Dave Syer opened SPR-17007 and commented

If SourceHttpMessageConverter fails to initialize itself it blows up a RestTemplate and then the whole bean factory on startup:

Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider not found
	at java.lang.Throwable.<init>(
	at java.lang.Error.<init>(
	at javax.xml.transform.TransformerFactoryConfigurationError.<init>(
	at javax.xml.transform.FactoryFinder.newInstance(
	at javax.xml.transform.FactoryFinder.find(
	at javax.xml.transform.TransformerFactory.newInstance(
	at org.springframework.http.converter.xml.SourceHttpMessageConverter.<init>(
	at org.springframework.web.client.RestTemplate.<init>(
	at org.springframework.boot.autoconfigure.http.HttpMessageConverters.getDefaultConverters(
	at org.springframework.boot.autoconfigure.http.HttpMessageConverters.<init>(
	at org.springframework.boot.autoconfigure.http.HttpMessageConverters.<init>(
	at org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.messageConverters(

The presence of a default implementation of TransformerFactory appears to be platform dependent, so RestTemplate and friends probably ought not to rely on their existence. E.g. a defensive type check might be needed.

Affects: 5.0.7

Issue Links:

  • #21529 Initial GraalVM native images (Substrate VM) support ("is depended on by")

Referenced from: commits b09fad1

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 23, 2018

Sébastien Deleuze commented

The TransactionFactory implementation is very specific and can vary, so I chose to just catch the error thrown when instantiating SourceHttpMessageConverter when no impl is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: enhancement
None yet

No branches or pull requests

2 participants