Skip to content

Windows issue? #1

@davepeaselumin

Description

@davepeaselumin

First of all, thanks for these examples - they have been really helpful.

I am experiencing an error when running the compiled .exe on Windows, linked to the scopes example.
(VS2022 Native Tools and GraalVM 22.3.0)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v3.0.0-SNAPSHOT)

2022-11-24T13:13:47.424Z  INFO 19812 --- [           main] com.example.aot.AotApplication           : Starting AOT-processed AotApplication using Java 17.0.5 with PID 19812 (C:\Users\AUser\Projects\workspace\java\spring-boot-3-aot\target\aot.exe started by AUser in C:\Users\AUser\Projects\workspace\java\spring-boot-3-aot\target)
2022-11-24T13:13:47.425Z  INFO 19812 --- [           main] com.example.aot.AotApplication           : No active profile set, falling back to 1 default profile: "default"
2022-11-24T13:13:47.434Z  INFO 19812 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'proxiesConfiguration' of type [com.example.aot.bpp.proxies.ProxiesConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-11-24T13:13:47.484Z  INFO 19812 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2022-11-24T13:13:47.484Z  INFO 19812 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-11-24T13:13:47.484Z  INFO 19812 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.1]
2022-11-24T13:13:47.492Z  INFO 19812 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-11-24T13:13:47.493Z  INFO 19812 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 68 ms
2022-11-24T13:13:47.508Z  WARN 19812 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextHttpController': Instantiation of supplied bean failed
2022-11-24T13:13:47.508Z  INFO 19812 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-11-24T13:13:47.509Z ERROR 19812 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextHttpController': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1236) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1210) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1157) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[aot.exe:6.0.1]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[aot.exe:6.0.1]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[aot.exe:6.0.1]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[aot.exe:3.0.0-SNAPSHOT]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) ~[aot.exe:3.0.0-SNAPSHOT]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432) ~[aot.exe:3.0.0-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[aot.exe:3.0.0-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302) ~[aot.exe:3.0.0-SNAPSHOT]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291) ~[aot.exe:3.0.0-SNAPSHOT]
        at com.example.aot.AotApplication.main(AotApplication.java:10) ~[aot.exe:na]
Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.example.aot.scopes.RequestContext: Common causes of this problem include using a final class or a non-visible class
        at org.springframework.aop.framework.CglibAopProxy.buildProxy(CglibAopProxy.java:216) ~[aot.exe:6.0.1]
        at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:158) ~[aot.exe:6.0.1]
        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[na:na]
        at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:143) ~[na:na]
        at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:84) ~[na:na]
        at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.getLazyResolutionProxyIfNecessary(ContextAnnotationAutowireCandidateResolver.java:54) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1322) ~[aot.exe:6.0.1]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:334) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:271) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206) ~[na:na]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainInstanceFromSupplier(AbstractAutowireCapableBeanFactory.java:1225) ~[aot.exe:6.0.1]
        ... 18 common frames omitted
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.NoSuchMethodException-->com.example.aot.scopes.RequestContext$$SpringCGLIB$$0.CGLIB$SET_THREAD_CALLBACKS([Lorg.springframework.cglib.proxy.Callback;)
        at org.springframework.cglib.proxy.Enhancer$EnhancerFactoryData.<init>(Enhancer.java:506) ~[na:na]
        at org.springframework.cglib.proxy.Enhancer.wrapCachedClass(Enhancer.java:801) ~[na:na]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:114) ~[na:na]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:111) ~[na:na]
        at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:55) ~[na:na]
        at [email protected]/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[aot.exe:na]
        at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:62) ~[na:na]
        at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:35) ~[na:na]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:137) ~[na:na]
        at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:322) ~[aot.exe:6.0.1]
        at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:567) ~[na:na]
        at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:412) ~[na:na]
        at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:62) ~[na:na]
        at org.springframework.aop.framework.CglibAopProxy.buildProxy(CglibAopProxy.java:213) ~[aot.exe:6.0.1]
        ... 28 common frames omitted
Caused by: java.lang.NoSuchMethodException: com.example.aot.scopes.RequestContext$$SpringCGLIB$$0.CGLIB$SET_THREAD_CALLBACKS([Lorg.springframework.cglib.proxy.Callback;)
        at [email protected]/java.lang.Class.getDeclaredMethod(DynamicHub.java:2675) ~[aot.exe:na]
        at org.springframework.cglib.proxy.Enhancer.getCallbacksSetter(Enhancer.java:907) ~[na:na]
        at org.springframework.cglib.proxy.Enhancer$EnhancerFactoryData.<init>(Enhancer.java:495) ~[na:na]
        ... 41 common frames omitted

Is there a hint I might be missing?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions