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

Support platforms where Class is not Serializable in SerializableTypeWrapper [SPR-16992] #21530

Closed
spring-issuemaster opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Jul 2, 2018

Sébastien Deleuze opened SPR-16992 and commented

When running Spring applications as native images via GraalVM, Class is not Serializable which trigger the following error as described here:

Exception in thread "main" java.lang.reflect.InvocationTargetException
 at java.lang.Throwable.<init>(Throwable.java:310)
 at java.lang.Exception.<init>(Exception.java:102)
 at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89)
 at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72)
 at com.oracle.svm.reflect.proxies.Proxy_1_Converter_main.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:173)
 Caused by: java.lang.IllegalArgumentException: Unsupported Type class: java.lang.Class
 at java.lang.Throwable.<init>(Throwable.java:265)
 at java.lang.Exception.<init>(Exception.java:66)
 at java.lang.RuntimeException.<init>(RuntimeException.java:62)
 at java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:52)
 at org.springframework.core.SerializableTypeWrapper.forTypeProvider(SerializableTypeWrapper.java:161)
 at org.springframework.core.SerializableTypeWrapper.forGenericInterfaces(SerializableTypeWrapper.java:102)
 at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:476)
 at org.springframework.core.ResolvableType.as(ResolvableType.java:436)
 at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:292)
 at org.springframework.core.convert.support.GenericConversionService.addConverterFactory(GenericConversionService.java:111)
 at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:135)
 at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:88)
 at org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:52)
 at Converter.<init>(Converter.java:6)
 at Converter.main(Converter.java:9)
 ... 3 more

SerializableTypeWrapper should support platforms where Class is not Serializable.


Issue Links:

  • #21529 Initial GraalVM native images (Substrate VM) support ("is depended on by")
  • #21543 DefaultParameterNameDiscoverer should automatically adapt to Graal constraints
  • #21673 Detect GraalVM with system property in SerializableTypeWrapper

Referenced from: commits 06f9fb9, 2ade122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment