-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
AspectJExpressionPointcut#getTargetShadowMatch
tentatively creates proxies for every bean
#29519
Comments
@goafabric thanks but that's not a Spring Boot concern. Moving to framework. |
|
Thx for answering that fast .. insanely fast ... #28711 is a little different It at least explains why i had to set But with this the invocation works .. for all use cases as long as it is a simple console application. Combine it with web and it crashes. So I guess this is a little different. |
AspectJExpressionPointcut#getTargetShadowMatch
tentatively create proxies for every bean
That's an interesting one. We have: @Component
@Aspect
public class TestAspect {
@Around("@within(org.goafabric.calleeservice.aspect.TestAnnotation)")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
try {
return joinPoint.proceed();
} finally {
final Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
System.err.println("aspects wrapped method : " + toString(method));
}
}
// ...
} The sample indeed fails with errors like:
So I began to add more proxy hints, but at some point I stopped because even with that hint configuration, that's not enough to make it work.
@jhoeller It looks like |
AspectJExpressionPointcut#getTargetShadowMatch
tentatively create proxies for every beanAspectJExpressionPointcut#getTargetShadowMatch
tentatively creates proxies for every bean
That composite interface creation is only really needed for default methods in interfaces and similar scenarios where interface-based method implementations are inherited rather than implemented locally. I've added a corresponding condition to reduce the creation of composite interfaces to actual method references in the current pointcut, that is, only when the pointcut actually refers to a non-overridden default method or the like. This should eliminate all of the common cases above. |
I confirm the example is now working as expected with method hints ( |
@sdeleuze boot 3.0.2-snapshot still seems to rely on framework-core 6.0.3 or do i just have to wait for a release ? :) thx |
Thanks should go to @jhoeller for the fix ;-) You can override the Framework version in Boot, otherwise just wait a bit, Spring Framework 6.0.4 has been released today and will be picked up by Boot shortly. |
yes i saw it on twitter yesterday evening, thx 4 letting me know and of course also to @jhoeller |
@sdeleuze As a sugar on top .. would it be possible to get rid of the "hints.reflection().registerType" ? Or .. "at least" as a fallback, at least have a working variant of "RegisterForReflectionBinding" Then it would also be nice to have spring cloud resilience4j working out of the box. And this basically needs |
Please create a related issue with me mentioned with a minimal reproducer and a detailed description of the type hint inference you would expect. |
So this is a continuation of
spring-attic/spring-native#956
which is still an open issue with Boot 3 (RC2 + latest snapshot)
While simple methods expressions like this just work fine
"execution(public * org.goafabric.calleeservice.aspect.TestComponent.*(..))"
More complex expressions, that e.g. leverage an custom anntotation, don't.
To be more specific .. they work with console applications, but crash the moment wie have WEB on the classpath.
Which somehow explains the error.
Tried to set the jdk proxy interfaces that graalvm demands, but stopped after the 3rd roundtrip because this seems
to be a neverending road ...
I've attached a simple example that works with non native, but crashes on bootstrap of the native image.
What's also a little mind boggeling .. is that i have to register a simple hint for the Test Aspect.
While the aot-smoke-tests don't ...
error.txt
example.zip
The text was updated successfully, but these errors were encountered: