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

BufferedImageHttpMessageConverter doesn't work on Google AppEngine [SPR-5975] #10643

Closed
spring-projects-issues opened this issue Aug 2, 2009 · 5 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Andrey Paramonov opened SPR-5975 and commented

After upgrading Spring version to 3.0.0, application deployed on GAE fails with exception:

Caused by: java.lang.NoClassDefFoundError: javax.imageio.ImageIO is a restricted class. Please see the Google App Engine developer's guide for more details.
	at com.google.apphosting.runtime.security.shared.stub.javax.imageio.ImageIO.<clinit>(ImageIO.java)
	at org.springframework.http.converter.BufferedImageHttpMessageConverter.<init>(BufferedImageHttpMessageConverter.java:70)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.<init>(AnnotationMethodHandlerAdapter.java:166)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Constructor_.newInstance(Constructor_.java:60)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:127)

See also: http://code.google.com/p/googleappengine/issues/detail?id=1268


Affects: 3.0 M3

Referenced from: commits 4267f84

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Arjen, can we somehow reflectively check whether to register that default BufferedImageHttpMessageConverter there? Or do some late initializiation of those default converters?

I wonder whether a Class.forName("javax.imageio.ImageIO") check actually works on a GAE: Is the class present and not usable there, or not present at all - in the sense of not visible in the ClassLoader?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Class.formName("javax.imageio.ImageIO") does not fail on GAE. It returns a proxy with some other type ("com.google.apphosting.runtime.security.shared.stub.javax.imageio.ImageIO") which then barfs if you try and use it.

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Thanks for investigating, Dave. I guess I will just remove the BufferedImageHttpMessageConverter as a default, so that it has to be enabled explicitly.

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

BufferedImageHttpMessageConverter removed as default.

@spring-projects-issues
Copy link
Collaborator Author

Andrey Paramonov commented

Issue resolved. Thanks Arjen.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M4 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants