Closed mpumd closed 2 years ago
If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
Hi mhalbritter,
Sorry for the lack of information. My simple test project is available on the following zip.
I build and run it with the following commands :
mvn clean test -PtracingAgent && mvn package -DskipTests -PaotCompile && mvn spring-boot:build-image -DskipTests -PnativeImage
docker run --rm -p 8081:8081 native-feign-client:0.0.1-SNAPSHOT
Thanks for your time.
I think this is the same as https://github.com/spring-projects-experimental/spring-native/issues/766... You need to downgrade to 0.10.6 and use as it is describe there.
Yes, like @lgklein said, this is not supported on 0.12.0. We're working on supporting that with Spring Boot 3.x and Spring Framework 6.x.
Hi everyone,
I tried to compile and run some applications that use the feign client.
My configuration is the following :
Compile is ok after add a trick like
--initialize-at-build-time=sun.instrument.InstrumentationImpl
. I combine the tracing agent results with the spring aot plugin. But during the run, spring boot fail to start in native image mode or spring Aot mode-DspringAot=true
So I confirmed my issue in a POC which gave me this following log :
. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.7.1)
2022-07-06 10:52:56.112 INFO 23072 --- [ main] c.l.n.f.NativeFeignClientApplication : Starting NativeFeignClientApplication v0.0.1-SNAPSHOT using Java 11.0.15 on DEVPC026599 with PID 2307 2 (E:\git\poc\native-feign-client\native-feign-client\target\native-feign-client-0.0.1-SNAPSHOT.jar started by mpusg in E:\git\poc\native-feign-client\native-feign-client) 2022-07-06 10:52:56.112 INFO 23072 --- [ main] c.l.n.f.NativeFeignClientApplication : No active profile set, falling back to 1 default profile: "default" 2022-07-06 10:52:57.034 INFO 23072 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) 2022-07-06 10:52:57.049 INFO 23072 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2022-07-06 10:52:57.049 INFO 23072 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.64] 2022-07-06 10:52:57.199 INFO 23072 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2022-07-06 10:52:57.199 INFO 23072 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1087 ms 2022-07-06 10:52:57.565 WARN 23072 --- [ main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework .beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans .factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.exa.nativetest.feign.FeignClientPublicApi' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} 2022-07-06 10:52:57.580 INFO 23072 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2022-07-06 10:52:57.627 ERROR 23072 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Parameter 0 of constructor in com.exa.nativetest.feign.Controller required a bean of type 'com.exa.nativetest.feign.FeignClientPublicApi' that could not be found.
Action:
Consider defining a bean of type 'com.exa.nativetest.feign.FeignClientPublicApi' in your configuration.
2022-07-06 09:03:25.789 ERROR 6848 --- [ main] s.a.c.b.g.ApplicationContextAotProcessor : Failed to handle bean com.exa.nativetest.feign.FeignClientPublicApi with definition Root bean: class [com.exa.nativetest.feign.FeignClientPublicApi]; scope=singleton; abstract=false; lazyInit=true; autowireMode=2; dependencyCheck=0; autowireCandidate=true; primary=true; factoryBeanName=null; factoryMe thodName=null; initMethodName=null; destroyMethodName=null
Any idea ? Thanks