Skip to content
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

AOT/native compilation not working with FeignClient and AOP #860

Closed
CC007 opened this issue Apr 21, 2023 · 60 comments · Fixed by #1030
Closed

AOT/native compilation not working with FeignClient and AOP #860

CC007 opened this issue Apr 21, 2023 · 60 comments · Fixed by #1030
Assignees
Labels
bug Something isn't working feedback-provided

Comments

@CC007
Copy link

CC007 commented Apr 21, 2023

Describe the bug
I read that starting spring-cloud 2022.0.0, you can use native compilation. I'm using 2022.0.2 (spring-cloud-starter-openfeign:4.0.2), but when I use an OpenFeign client with native compilation, I get the following error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'boxedHelloController': Unsatisfied dependency expressed through field 'helloWorldClient': Error creating bean with name 'nl.cqit.function.poc.java.helloworld.controller.HelloWorldClient': Post-processing of FactoryBean's singleton object failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:195) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167) ~[na:na]
        at nl.cqit.function.poc.java.boxedhello.controller.BoxedHelloController__Autowiring.apply(BoxedHelloController__Autowiring.java:15) ~[na:na]
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[boxedhello-app.exe:3.0.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[boxedhello-app.exe:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[boxedhello-app.exe:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[boxedhello-app.exe:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[boxedhello-app.exe:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[boxedhello-app.exe:3.0.5]
        at nl.cqit.function.poc.java.boxedhello.Main.main(Main.java:12) ~[boxedhello-app.exe:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.cqit.function.poc.java.helloworld.controller.HelloWorldClient': Post-processing of FactoryBean's singleton object failed
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:108) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1823) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1273) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:259) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1640) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1597) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
        ... 22 common frames omitted
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface nl.cqit.function.poc.java.helloworld.controller.HelloWorldClient, interface org.springframework.aop.SpringProxy, interface org.springframework.aop.framework.Advised, interface org.springframework.core.DecoratingProxy] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171) ~[na:na]
        at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[boxedhello-app.exe:na]
        at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[boxedhello-app.exe:na]
        at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:123) ~[na:na]
        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[na:na]
        at org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.postProcessAfterInitialization(AbstractAdvisingBeanPostProcessor.java:127) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:434) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1885) ~[boxedhello-app.exe:6.0.7]
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:105) ~[boxedhello-app.exe:6.0.7]
        ... 32 common frames omitted

Sample
Here is my API:

package nl.cqit.function.poc.java.helloworld.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import nl.cqit.function.poc.java.helloworld.api.model.Person;
import nl.cqit.function.poc.java.helloworld.api.model.Problem;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;

@Validated
@Tag(
    name = "HelloWorld",
    description = "the HelloWorld API"
)
public interface HelloWorldApi {
    @Operation(
        operationId = "sayHello",
        summary = "The main function",
        description = "This endpoint will call sayHello",
        tags = {"HelloWorld"},
        responses = {@ApiResponse(
    responseCode = "200",
    description = "OK",
    content = {@Content(
    mediaType = "application/json",
    schema = @Schema(
    implementation = String.class
)
), @Content(
    mediaType = "application/problem+json",
    schema = @Schema(
    implementation = String.class
)
)}
), @ApiResponse(
    responseCode = "400",
    description = "input validation failed",
    content = {@Content(
    mediaType = "application/json",
    schema = @Schema(
    implementation = Problem.class
)
), @Content(
    mediaType = "application/problem+json",
    schema = @Schema(
    implementation = Problem.class
)
)}
)}
    )
    @RequestMapping(
        method = {RequestMethod.POST},
        value = {"/helloWorld"},
        produces = {"application/json", "application/problem+json"},
        consumes = {"application/json"}
    )
    @ResponseStatus(HttpStatus.OK)
    String sayHello(@Parameter(name = "Person",description = "",required = true) @RequestBody @Valid Person var1);
}

And here is my Feign client:

package nl.cqit.function.poc.java.helloworld.controller;

import nl.cqit.function.poc.java.helloworld.api.HelloWorldApi;
import org.springframework.cloud.openfeign.FeignClient;

@FeignClient(name = "helloWorldClient", url = "http://localhost:8080")
public interface HelloWorldClient extends HelloWorldApi {
}

I'm using it like this:

package nl.cqit.function.poc.java.boxedhello.impl;

import nl.cqit.function.poc.java.boxedhello.api.BoxedHelloApi;
import nl.cqit.function.poc.java.boxedhello.api.model.Person;
import nl.cqit.function.poc.java.helloworld.controller.HelloWorldClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BoxedHelloImpl implements BoxedHelloApi {

    @Autowired
    private HelloWorldClient helloWorldClient;

    @Override
    public String sayHello(Person person) {
        String greeting = helloWorldClient.sayHello(map(person));
        String horizontalEdge = "+" + "-".repeat(greeting.length() + 2) + "+";
        return horizontalEdge + "\n| " + greeting + " |\n" + horizontalEdge;
    }

    private nl.cqit.function.poc.java.helloworld.api.model.Person map(Person person) {
        return new nl.cqit.function.poc.java.helloworld.api.model
                .Person(person.getFirstName())
                .lastName(person.getLastName());
    }
}

With this as my Main class:

package nl.cqit.function.poc.java.boxedhello;

import nl.cqit.function.poc.java.helloworld.controller.HelloWorldClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

@EnableFeignClients(basePackageClasses = {HelloWorldClient.class})
@SpringBootApplication
public class Main {
    public static void main(String[] args) {
        SpringApplication.run(Main.class, args);
    }
}

Using this profile for native compilation in my pom.xml:

<profiles>
        <profile>
            <id>native</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <image>
                                <builder>paketobuildpacks/builder:tiny</builder>
                                <env>
                                    <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                                </env>
                            </image>
                        </configuration>
                        <executions>
                            <execution>
                                <id>process-aot</id>
                                <goals>
                                    <goal>process-aot</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <configuration>
                            <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                            <metadataRepository>
                                <enabled>true</enabled>
                            </metadataRepository>
                            <requiredVersion>22.3</requiredVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>build-native</id>
                                <goals>
                                    <goal>compile-no-fork</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                            <execution>
                                <id>add-reachability-metadata</id>
                                <goals>
                                    <goal>add-reachability-metadata</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

Is this a bug or am I missing something?

@Rocker93
Copy link

This issue started occurring after upgrading to Spring Boot 3.0.6 from 3.0.5 so it seems to be some regression bug. Unfortunately I have not been able to track down what causes it.

@CC007
Copy link
Author

CC007 commented Apr 24, 2023

I was able to get somewhat further when manually adding the aot hint for a proxy for the client interface. It now allows the application to start, albeit slowly, due to a missing resource (not at my pc atm. I'll post the specific logs later), but it can't find the HttpMessageConverter when trying to use the client. I'll see if I can make a public git repo available demonstrating the issues, when I have time.

@CC007
Copy link
Author

CC007 commented Apr 25, 2023

@Rocker93 I am actually using 3.0.5

@OlgaMaciaszek
Copy link
Collaborator

Hello, @CC007 @Rocker93 , if you could provide a link to a sample, that would be helpful. We do have a working sample here. I will look into the code you've provided anyway, but will need some time as we have various issues queued up at this point.

@CC007
Copy link
Author

CC007 commented Apr 27, 2023

@OlgaMaciaszek
I made my repo public for now. You can find it here: https://github.com/CodeQualIT/CQITFunctions

@OlgaMaciaszek
Copy link
Collaborator

Thanks a lot, @CC007. Should be able to get to it around 8th of May.

@CC007
Copy link
Author

CC007 commented May 6, 2023

No problem. If you have any questions, feel free to reply here or message me on Discord: cc007#2753

@CC007
Copy link
Author

CC007 commented May 7, 2023

Also, one thing I noticed is that when org.springframework.cloud.client.HostInfoEnvironmentPostProcessor is trying to get the config for spring.cloud.inetutils, used in the instantiation of org.springframework.cloud.commons.util.InetUtils on line 60 of the post processor, that the config isn't loaded correctly.

InetUtils in org.springframework.cloud.commons.util.UtilAutoConfiguration doesn't seem to have the same issue, because that one seems to get fully initialized before use.

This leads to a significant startup delay, because I'm using a vEthernet (External switch) adapter from hyper-v to route my internet (this was needed to get LAN IP addresses for my hyper-v VMs).
Adding...

spring:
  cloud:
    inetutils:
      preferred-networks:
        - 192.168

...should have fixed this, but due to the config not getting picked up in the post processor, the startup delay is not prevented.

This happened even without native compilation.

@CC007
Copy link
Author

CC007 commented May 7, 2023

I think the issue in my previous comment is out of scope, so I created an issue in the appropriate issue tracker: spring-cloud/spring-cloud-commons#1233

@CC007
Copy link
Author

CC007 commented May 8, 2023

FYI: I manually added https://github.com/CodeQualIT/CQITFunctions/blob/master/pocs/boxedhello-project/boxedhello-generated/boxedhello-clients/boxedhello-helloworld-client/src/main/java/nl/cqit/function/poc/java/boxedhello/services/helloworld/HelloWorldServiceRuntimeHints.java as a partial workaround. This makes it so that the application starts, but it still causes issues when calling the client. Also, I'd expect these runtime hints for feign clients to be automatically added by openfeign, without user intervention.

@OlgaMaciaszek
Copy link
Collaborator

Hello @CC007 , I've tried running the project, but the HelloWorldApi class is not available, so it does not compile. Please provide a minimal, executable sample that we can run and debug.

@OlgaMaciaszek
Copy link
Collaborator

OlgaMaciaszek commented May 11, 2023

Probably caused by Spring Boot issue: spring-projects/spring-boot#35397.

@CC007
Copy link
Author

CC007 commented May 11, 2023

Hello @CC007 , I've tried running the project, but the HelloWorldApi class is not available, so it does not compile. Please provide a minimal, executable sample that we can run and debug.

There are 2 projects in the poc folder: helloworld and boxedhello. Boxedhello uses the interface of helloworld to create a feign client.

I now created a 3rd project in the poc folder with the amount of modules reduced and with the helloworld interface added as submodule, so that it can be built independently.

@OlgaMaciaszek
Copy link
Collaborator

OlgaMaciaszek commented May 15, 2023

Thanks, @CC007.

It seems 2 different issues have been discussed here. @Rocker93 if you have a project not working with Boot 3.0.6, but working with Boot 3.0.5, it's probably the regression I've linked above, and your project should work again on the newest Boot snapshots and Boot 3.0.7.

The second issue is the one present in the project @CC007 has linked. This issue seems specifically linked to the use of AOP alongside OpenFeign. I was able to reproduce it. Looks like a bug.

@OlgaMaciaszek OlgaMaciaszek added bug Something isn't working and removed feedback-provided labels May 15, 2023
@OlgaMaciaszek OlgaMaciaszek changed the title AOT/native compilation not working AOT/native compilation not working with FeignClient and ControllerAdvise May 15, 2023
@OlgaMaciaszek OlgaMaciaszek changed the title AOT/native compilation not working with FeignClient and ControllerAdvise AOT/native compilation not working with FeignClient and AOP May 15, 2023
@CC007
Copy link
Author

CC007 commented May 15, 2023

The question is: is this one bug or 2 bugs?

The fact that I manually have to add the runtime hint is one bug, but I don't know if the errors I get related to HttpMessageConverter after manually adding the hints is the same bug or a second bug.

Is that one also caused by a missing runtime hints?

@CC007
Copy link
Author

CC007 commented May 26, 2023

Any progress regarding this issue?

@OlgaMaciaszek
Copy link
Collaborator

@CC007 I will work on it this week or at the beginning of the next week.

@OlgaMaciaszek
Copy link
Collaborator

Thanks @dpozinen, as requested above, please provide a minimal, complete, verifiable example that reproduces the issue.

@spring-cloud-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@til-avalaszek
Copy link

til-avalaszek commented May 4, 2024

I found the problem. It's happen when I use @Cacheable inside FeignClient interface. I removed and resolve the problem. Thanks.

@CC007
Copy link
Author

CC007 commented May 4, 2024

I will also check to see if it resolved the issue on my side. I'll keep you posted.

@CC007
Copy link
Author

CC007 commented May 4, 2024

It seems to work on the minimal-upgraded-sample branch, but on the master branch I do get an exception when I try to call the endpoint:

feign.codec.EncodeException: Could not write request: no suitable HttpMessageConverter found for request type [nl.cqit.function.poc.java.helloworld.api.model.Person] and content type [application/json]
        at org.springframework.cloud.openfeign.support.SpringEncoder.encodeWithMessageConverter(SpringEncoder.java:170) ~[na:na]
        at org.springframework.cloud.openfeign.support.SpringEncoder.encode(SpringEncoder.java:117) ~[na:na]
        at feign.RequestTemplateFactoryResolver$BuildEncodedTemplateFromArgs.resolve(RequestTemplateFactoryResolver.java:273) ~[na:na]
        at feign.RequestTemplateFactoryResolver$BuildTemplateByResolvingArgs.create(RequestTemplateFactoryResolver.java:106) ~[boxedhello-minimal-app.exe:na]
        at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:65) ~[na:na]
        at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99) ~[na:na]
        at jdk.proxy4/jdk.proxy4.$Proxy44.sayHello(Unknown Source) ~[na:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:580) ~[boxedhello-minimal-app.exe:na]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:174) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223) ~[na:na]
        at jdk.proxy4/jdk.proxy4.$Proxy45.sayHello(Unknown Source) ~[na:na]
        at nl.cqit.function.poc.java.boxedhello.impl.BoxedHelloImpl.sayHello(BoxedHelloImpl.java:17) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:580) ~[boxedhello-minimal-app.exe:na]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768) ~[na:na]
        at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:174) ~[na:na]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768) ~[na:na]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720) ~[na:na]
        at nl.cqit.function.poc.java.boxedhello.controller.BoxedHelloController$$SpringCGLIB$$0.sayHello(<generated>) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.reflect.Method.invoke(Method.java:580) ~[boxedhello-minimal-app.exe:na]
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[boxedhello-minimal-app.exe:6.1.6]
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[boxedhello-minimal-app.exe:6.0]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[boxedhello-minimal-app.exe:6.1.6]
        at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[boxedhello-minimal-app.exe:6.0]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:206) ~[na:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150) ~[na:na]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[boxedhello-minimal-app.exe:10.1.20]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175) ~[na:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150) ~[na:na]
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175) ~[na:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150) ~[na:na]
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175) ~[na:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150) ~[na:na]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:175) ~[na:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:150) ~[na:na]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[na:na]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[na:na]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[boxedhello-minimal-app.exe:10.1.20]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[na:na]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[boxedhello-minimal-app.exe:10.1.20]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[na:na]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) ~[na:na]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) ~[na:na]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[boxedhello-minimal-app.exe:10.1.20]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) ~[na:na]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736) ~[na:na]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[boxedhello-minimal-app.exe:10.1.20]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[na:na]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[na:na]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[na:na]
        at [email protected]/java.lang.Thread.runWith(Thread.java:1596) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.Thread.run(Thread.java:1583) ~[boxedhello-minimal-app.exe:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896) ~[boxedhello-minimal-app.exe:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872) ~[boxedhello-minimal-app.exe:na]

Using the master branch of boxedhello-minimal-app (while helloworld-app is also running of course)

I might be missing something small and stupid, but I don't see the reason for this error.

@OlgaMaciaszek
Copy link
Collaborator

@CC007 I have requested the minimal sample, because the master had too much things unrelated to the project set up. Please see if you can reproduce it with something more minimal. If not, I'll take a second look at it later on.

@OlgaMaciaszek
Copy link
Collaborator

@til-avalaszek @Cacheable is not properly supported with SC OF clients at this point (https://github.com/spring-cloud/spring-cloud-openfeign/issues?q=is%3Aissue+is%3Aopen+cacheable). I suggest avoiding it till the issues listed are resolved.

@CC007
Copy link
Author

CC007 commented May 6, 2024

Hmm... I created a new branch named minimal-with-openapi, but that one seems to also work fine, even though it's not that different from the master branch.

I'll research a little bit more why there's a difference.

@OlgaMaciaszek
Copy link
Collaborator

ok, @CC007, please get back to us once you've got more details or a minimal reproducer.

@CC007
Copy link
Author

CC007 commented May 9, 2024

I narrowed it down to whether the helloworld and boxedhello controller are in the same application or separate applications.

See minimal-with-openapi vs minimal-separate-apps, where minimal-with-openapi does work and minimal-separate-apps gives the exception when natively compiled.

Simply moving over the HelloWorldController, HelloWorldControllerAdvice and HelloWorldImpl class to the boxedhello app module and changing the port to 8080 instead of 8090 (or by making the HelloWorldService's feign client use port 8090), it suddenly works, without any explanation why it didn't beforehand.

@OlgaMaciaszek
Copy link
Collaborator

Thanks, @CC007 - will take a look.

@OlgaMaciaszek
Copy link
Collaborator

@CC007 Have submitted a change that should fix the issue.

@CC007
Copy link
Author

CC007 commented May 13, 2024

Ah, from what I gather from the commit, the issue was that the abstract methods were defined on (one of) the super interface(s). I'll take a look to see if this fixes my issue (and might even remove the need for the type hint that I already added).

@CC007
Copy link
Author

CC007 commented May 13, 2024

Woo!

HTTP/1.1 200 
Content-Type: application/json
Content-Length: 77
Date: Mon, 13 May 2024 21:16:14 GMT

+-----------------------+
| Hello, Separate Apps! |
+-----------------------+

Thank you very much for your help, @OlgaMaciaszek ! There was a lot of effort on your part to get it working.

It does still rely on HelloWorldServiceRuntimeHints though. Without it I get this error on startup:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'boxedHelloController': Unsatisfied dependency expressed through field 'helloWorldService': Error creating bean with nam
e 'nl.cqit.function.poc.java.boxedhello.services.helloworld.HelloWorldService': Post-processing of FactoryBean's singleton object failed
2024-05-13T23:20:57.659+02:00  WARN 11292 --- [           main] o.s.c.support.GenericApplicationContext  : Exception thrown from ApplicationListener handling ContextClosedEvent

org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'applicationTaskExecutor': Singleton b
ean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.event.AbstractApplicationEventMulticaster.retrieveApplicationListeners(AbstractApplicationEventMulticaster.java:265) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:222) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) ~[na:na]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:457) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1130) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1093) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.cloud.context.named.NamedContextFactory.destroy(NamedContextFactory.java:113) ~[boxedhello-minimal-app.exe:4.1.2]
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211) ~[na:na]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1202) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1195) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1186) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:637) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[boxedhello-minimal-app.exe:3.2.5]   
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[boxedhello-minimal-app.exe:3.2.5]
        at nl.cqit.function.poc.java.Main.main(Main.java:12) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH) ~[na:na]

2024-05-13T23:20:57.661+02:00  INFO 11292 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]   
2024-05-13T23:20:57.662+02:00 ERROR 11292 --- [           main] o.s.boot.SpringApplication               : Application run failed      

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'boxedHelloController': Unsatisfied dep
endency expressed through field 'helloWorldService': Error creating bean with name 'nl.cqit.function.poc.java.boxedhello.services.helloworld.HelloWorldService': Post-processing of FactoryBean's singleton object failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167) ~[na:na]
        at nl.cqit.function.poc.java.boxedhello.controller.BoxedHelloController__Autowiring.apply(BoxedHelloController__Autowiring.java:17) ~[na:na]
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1217) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1161) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[boxedhello-minimal-app.exe:3.2.5]   
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[boxedhello-minimal-app.exe:3.2.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[boxedhello-minimal-app.exe:3.2.5]
        at nl.cqit.function.poc.java.Main.main(Main.java:12) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH) ~[na:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nl.cqit.function.poc.java.boxedhello.services.helloworld.HelloWorldService': Post-processing of FactoryBean's singleton object failed
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1850) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1276) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:259) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1696) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1653) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1397) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188) ~[na:na]
        ... 23 common frames omitted
Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inherit
ing [nl.cqit.function.poc.java.boxedhello.services.helloworld.HelloWorldService, org.springframework.aop.SpringProxy, org.springframewo
rk.aop.framework.Advised, org.springframework.core.DecoratingProxy] without it being registered for runtime reflection. Add [nl.cqit.fu
nction.poc.java.boxedhello.services.helloworld.HelloWorldService, org.springframework.aop.SpringProxy, org.springframework.aop.framewor
k.Advised, org.springframework.core.DecoratingProxy] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.    
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89) ~[na:na]
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176) ~[na:na]
        at [email protected]/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47) ~[boxedhello-minimal-app.exe:na]
        at [email protected]/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034) ~[boxedhello-minimal-app.exe:na]
        at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:124) ~[na:na]
        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[na:na]
        at org.springframework.aop.framework.AbstractAdvisingBeanPostProcessor.postProcessAfterInitialization(AbstractAdvisingBeanPostProcessor.java:127) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:438) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1907) ~[boxedhello-minimal-app.exe:6.1.6]
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:139) ~[boxedhello-minimal-app.exe:6.1.6]
        ... 33 common frames omitted

For now that's fine though, unless you feel like you want to fix that too.

@OlgaMaciaszek
Copy link
Collaborator

Thanks @CC007, will take a look at it today.

@OlgaMaciaszek
Copy link
Collaborator

@CC007 This seems to be related to having both the OF proxy and advised proxies used together. This is a specific scenario that has not been reported by others, so I'd say you should just use the hints registrar.

@dpozinen
Copy link

dpozinen commented May 15, 2024

I have verified it works for me as well with the hints. Thank you for your efforts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback-provided
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants