-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WARNING: An illegal reflective access operation has occurred #3765
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
Comments
This has nothing to do with Spring Integration. See that log carefully around A general answer: such a warning is going to disappear itself when some future Java version will release possible reflection replacement for those features. Closed as |
Thank you for your comments @artembilan |
Hi @artembilan. I came across the same issue with Spring Boot 2.6.6, Spring Integration 5.5.10 on JDK 11. You mention that such a warning is going to disappear itself but I wonder if this is the case. I found a very similar issue that was opened in Spring Data: spring-projects/spring-data-commons#1811 I believe that the issue reported here occurs in: https://github.com/spring-projects/spring-integration/blob/main/spring-integration-core/src/main/java/org/springframework/integration/gateway/DefaultMethodInvokingMethodInterceptor.java Does it make sense to reopen this issue and consider a change similar to what was done in Spring Data? |
Sure! I see what you mean. Spring Data has fixed it via their own Let me see what we can do over here is Spring Integration. Thank you! |
Fixes spring-projects#3765 The `DefaultMethodInvokingMethodInterceptor` has several strategies for `default` method invocations in the messaging gateway. One of them is based on the `Lookup` constructor which causes a `WARNING: An illegal reflective access operation has occurred`. This can be done lazily when there is no `MethodHandles.privateLookupIn` in Java version used for the project. * Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in a lazy manner via `Supplier` and `boolean` flag **Cherry-pick to `5.5.x`**
Fixes #3765 The `DefaultMethodInvokingMethodInterceptor` has several strategies for `default` method invocations in the messaging gateway. One of them is based on the `Lookup` constructor which causes a `WARNING: An illegal reflective access operation has occurred`. This can be done lazily when there is no `MethodHandles.privateLookupIn` in Java version used for the project. * Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in a lazy manner via `Supplier` and `boolean` flag **Cherry-pick to `5.5.x`**
Fixes #3765 The `DefaultMethodInvokingMethodInterceptor` has several strategies for `default` method invocations in the messaging gateway. One of them is based on the `Lookup` constructor which causes a `WARNING: An illegal reflective access operation has occurred`. This can be done lazily when there is no `MethodHandles.privateLookupIn` in Java version used for the project. * Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in a lazy manner via `Supplier` and `boolean` flag **Cherry-pick to `5.5.x`**
Thank you for the quick turnaround @artembilan , appreciate it! |
In what version(s) of Spring Integration are you seeing this issue?
For example:
5.3.18.RELEASE
Describe the bug
When I annotated with @MessagingGateway my interface and run my component I got "WARNING: An illegal reflective access operation has occurred".
To Reproduce
@MessagingGateway(defaultRequestChannel = "cesvivinOutboundChannel")
public interface CesvivinOutboundPort {
void produce (final Cesvivin cesvivin);
}
@configuration
public class CesvivinOutboundConfig {
/**
*/
@value("${topic.cesvivn.name}")
private String topic;
/**
*/
@bean
public MessageChannel cesvivinOutboundChannel () {
return new PublishSubscribeChannel();
}
/**
*/
@bean
@serviceactivator(inputChannel = "cesvivinOutboundChannel")
public MessageHandler sender (final PubSubTemplate pubSubTemplate) {
return new PubSubMessageHandler(pubSubTemplate, topic);
}
/**
*/
@bean
public PubSubMessageConverter pubSubMessageConverter () {
return new JacksonPubSubMessageConverter(new ObjectMapper());
}
}
Expected behavior
$ ./gradlew bootRun
The text was updated successfully, but these errors were encountered: