-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make it possible to run Spring ConversionService with Substrate VM #507
Comments
I think this is because public class Types {
public static void main(String[] args) {
new Types().run();
}
private void run() {
System.err.println(Class.class instanceof Serializable);
}
} |
Good catch, we are going to avoid making such assumption in Spring Framework 5.1, see SPR-16992. |
I am reopening this issue since we found a very strange behavior. Code bellow
Prints:
Isn't that strange that |
In addition to the point raised above, I would be interested to know what conditional test we should use to detect that we are compiler/running as native images. Ideally something that does not require GraalVM specific API. |
The static initializer that initializes The code in the method I'm changing the Note that Substrate VM does not support Java serialization yet. |
Regarding the conditional test: Currently there is nothing like that. The only option I see that works without GraalVM API is to have a system property that has a different value during image generation and at image run time. |
For the conditional test, for such need we usually detect classes with |
We merged a new API last week that adds official support for detecting if you are running in the image builder or at image runtime using a system property: Since the property name and its values are considered API (and not just the static field names), you can add a system property based check (basically copying the contents of the methods of the ImageInfo class. The properties will be in the August release of GraalVM (probably going to be online in the first week of August). |
And the fix for |
@christianwimmer is this fix deployed ? |
With this simple project that has only a dependency on
spring-core-5.0.7.RELEASE
:With following proxy configuration:
Using on GraalVM
master
, it complies fine but generates this error when running:Any chance to fix this or to give us some hints about how to find to right configuration to avoid this error?
The text was updated successfully, but these errors were encountered: