Closed rdpagft closed 2 years ago
This has nothing to do with Spring Integration. See that log carefully around spring-core
.
There are many similar reports: https://github.com/spring-projects/spring-framework/issues?q=is%3Aissue+An+illegal+reflective+access+operation+has+occurred.
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 Invalid
.
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: https://github.com/spring-projects/spring-data-commons/issues/1811 The Spring Data issue was in their implementation of DefaultMethodInvokingMethodInterceptor. The Spring Data team pushed a fix for this: https://github.com/spring-projects/spring-data-commons/pull/307/commits/80dc64b8c142e971333a9a080593cbb94cd06877
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 Lazy
abstraction do not call ctor = Lookup.class.getDeclaredConstructor(Class.class);
eagerly if privateLookupIn
is already available.
Let me see what we can do over here is Spring Integration.
Thank you!
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 {
/**
Nombre de la suscripción del tópico para registrar alta de robo. */ @Value("${topic.cesvivn.name}") private String topic;
/**
@return Una lista {@link List} de objetos tipo {@link MessageChannel}. */ @Bean public MessageChannel cesvivinOutboundChannel () { return new PublishSubscribeChannel(); }
/**
@return Una instancia de tipo {@link MessageHandler}. */ @Bean @ServiceActivator(inputChannel = "cesvivinOutboundChannel") public MessageHandler sender (final PubSubTemplate pubSubTemplate) { return new PubSubMessageHandler(pubSubTemplate, topic); }
/**
Expected behavior
$ ./gradlew bootRun