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

[BUG] Azure servicebus has a NoSuchMethodException after native compile #43106

Open
3 tasks done
khauser opened this issue Nov 26, 2024 · 2 comments
Open
3 tasks done
Labels
azure-spring All azure-spring related issues customer-reported Issues that are reported by GitHub users external to the Azure organization. graalvm Label for tracking issues related to graalvm needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@khauser
Copy link

khauser commented Nov 26, 2024

Describe the bug
I do have an application connecting itself to the azure servicebus. It works well as normal Java-Code but not after I convert it into native code.

Exception or Stack Trace

Caused by: java.lang.NoSuchMethodException: com.azure.servicebus.jms.ServiceBusJmsConnectionFactory.<init>(java.lang.String, com.azure.servicebus.jms.ServiceBusJmsConnectionFactorySettings)
        at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1075)
        at [email protected]/java.lang.Class.getConstructor0(DynamicHub.java:1238)
        at [email protected]/java.lang.Class.getConstructor(DynamicHub.java:2442)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryFactory.createConnectionFactoryInstance(ServiceBusJmsConnectionFactoryFactory.java:80)

To Reproduce
build.gradle:

plugins {
     // spring boot plugin
    id 'org.springframework.boot' version '3.3.6'
    id 'io.spring.dependency-management' version '1.1.6'
...
graalvmNative {
  binaries {

      main {
          buildArgs.add('-Djava.security.properties=' + file("$rootDir/src/main/resources/custom.security").absolutePath)
          buildArgs.add('--initialize-at-build-time=org.slf4j')
      }
  }
}

bootBuildImage {
    builder.set("paketobuildpacks/builder-jammy-base:latest")

    imageName = "ishisteacr.azurecr.io/iste/iste-message"
    if (project.hasProperty('imageVersion')) {
        tags.add("ishisteacr.azurecr.io/iste/iste-message:${project.imageVersion}")
    } else {
        tags.add("ishisteacr.azurecr.io/iste/iste-message:$version")
    }
    environment = [
            'BP_JVM_VERSION'                 : "21",
            'BP_NATIVE_IMAGE'                : 'true',
            'BP_NATIVE_IMAGE_BUILD_ARGUMENTS': '-H:+AddAllCharsets ' + '-H:NumberOfThreads=4 ' +
                    '--initialize-at-build-time=org.slf4j ' +
                    '-Djava.security.properties=/workspace/BOOT-INF/classes/custom.security ',
    ]
}

NativeRuntimeHints.java:

@ImportRuntimeHints(NativeRuntimeHints.MyRuntimeHintsRegistrar.class)
@Configuration
public class NativeRuntimeHints
{
    static class MyRuntimeHintsRegistrar implements RuntimeHintsRegistrar
    {
        @Override
        public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
        {
            hints.resources().registerPattern("*.yml");
            hints.resources().registerPattern("*.security");

            hints.reflection()
                 .registerType(TypeReference.of("com.azure.core.util.logging.ClientLogger"),
                                 MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
            hints.reflection()
                 .registerType(TypeReference.of("ch.qos.logback.core.util.StatusPrinter2"),
                                 MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);

        }
    }
}

./gradlew nativeCompile and ./gradlew bootBuildImage are successful but do fail when starting the exe or the image.

Expected behavior
The native application should start without exception.

Setup (please complete the following information):

  • OS: Windows
  • IDE: eclipse
  • Library/Libraries: implementation group: 'com.azure.spring', name: 'spring-cloud-azure-starter-servicebus-jms', version: "5.18.0"
  • Java version: Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
  • App Server/Environment: Tomcat
  • Frameworks: Spring Boot+native

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs
Microsoft Windows [Version 10.0.22631.4460]
(c) Microsoft Corporation. All rights reserved.

d:\Arbeit\azureISTE\test-iste-message\build\native\nativeCompile>test-iste-message.exe
 (    (                      *
 )\ ) )\ )  *   )          (  `
(()/((()/(` )  /( (        )\))(     (             )  (  (     (
 /(_))/(_))( )(_)))\  ___ ((_)()\   ))\ (   (   ( /(  )\))(   ))\
(_)) (_)) (_(_())((_)|___|(_()((_) /((_))\  )\  )(_))((_))\  /((_)
|_ _|/ __||_   _|| __|    |  \/  |(_)) ((_)((_)((_)_  (()(_)(_))
 | | \__ \  | |  | _|     | |\/| |/ -_)(_-<(_-</ _` |/ _` | / -_)
|___||___/  |_|  |___|    |_|  |_|\___|/__//__/\__,_|\__, | \___|
                                                     |___/

2024-11-26T13:52:50.104+01:00  INFO 6780 --- [iste-message] [           main] c.i.iste.message.ISTEMessageApplication  : Starting AOT-processed ISTEMessageApplication using Java 21.0.2 with PID 6780 (d:\Arbeit\azureISTE\test-iste-message\build\native\nativeCompile\test-iste-message.exe started by KHauser in d:\Arbeit\azureISTE\test-iste-message\build\native\nativeCompile)
2024-11-26T13:52:50.105+01:00  INFO 6780 --- [iste-message] [           main] c.i.iste.message.ISTEMessageApplication  : The following 1 profile is active: "default"
2024-11-26T13:52:50.106+01:00  INFO 6780 --- [iste-message] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=395397df-6460-3182-9f22-7238ff4a6e0f
2024-11-26T13:52:50.108+01:00  WARN 6780 --- [iste-message] [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [lbRestClientPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
2024-11-26T13:52:50.109+01:00  WARN 6780 --- [iste-message] [           main] trationDelegate$BeanPostProcessorChecker : Bean 'deferringLoadBalancerInterceptor' of type [org.springframework.cloud.client.loadbalancer.DeferringLoadBalancerInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [lbRestClientPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
2024-11-26T13:52:50.126+01:00  INFO 6780 --- [iste-message] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-11-26T13:52:50.127+01:00  INFO 6780 --- [iste-message] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-11-26T13:52:50.127+01:00  INFO 6780 --- [iste-message] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.33]
2024-11-26T13:52:50.133+01:00  INFO 6780 --- [iste-message] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-11-26T13:52:50.133+01:00  INFO 6780 --- [iste-message] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 28 ms
2024-11-26T13:52:50.152+01:00  WARN 6780 --- [iste-message] [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncMessageController': Unsatisfied dependency expressed through field 'messageService': Error creating bean with name 'messageService': Unsatisfied dependency expressed through field 'serviceFactory': Error creating bean with name 'messageServiceFactory': Unsatisfied dependency expressed through field 'senderList': Error creating bean with name 'azureBusMessageSender': Unsatisfied dependency expressed through field 'azureBusService': Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
2024-11-26T13:52:50.153+01:00  INFO 6780 --- [iste-message] [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncMessageController': Unsatisfied dependency expressed through field 'messageService': Error creating bean with name 'messageService': Unsatisfied dependency expressed through field 'serviceFactory': Error creating bean with name 'messageServiceFactory': Unsatisfied dependency expressed through field 'senderList': Error creating bean with name 'azureBusMessageSender': Unsatisfied dependency expressed through field 'azureBusService': Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
        at com.intershop.iste.message.controller.AsyncMessageController__Autowiring.apply(AsyncMessageController__Autowiring.java:18)
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149)
        at com.intershop.iste.message.ISTEMessageApplication.main(ISTEMessageApplication.java:11)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageService': Unsatisfied dependency expressed through field 'serviceFactory': Error creating bean with name 'messageServiceFactory': Unsatisfied dependency expressed through field 'senderList': Error creating bean with name 'azureBusMessageSender': Unsatisfied dependency expressed through field 'azureBusService': Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
        at com.intershop.iste.message.service.MessageService__Autowiring.apply(MessageService__Autowiring.java:16)
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
        ... 22 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageServiceFactory': Unsatisfied dependency expressed through field 'senderList': Error creating bean with name 'azureBusMessageSender': Unsatisfied dependency expressed through field 'azureBusService': Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
        at com.intershop.iste.message.service.MessageServiceFactory__Autowiring.apply(MessageServiceFactory__Autowiring.java:17)
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
        ... 38 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'azureBusMessageSender': Unsatisfied dependency expressed through field 'azureBusService': Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
        at com.intershop.iste.message.service.azure.AzureBusMessageSender__Autowiring.apply(AzureBusMessageSender__Autowiring.java:17)
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1689)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1653)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeanCollection(DefaultListableBeanFactory.java:1543)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1511)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1392)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
        ... 54 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'azureBusService': Unsatisfied dependency expressed through field 'jmsTemplate': Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:194)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167)
        at com.intershop.iste.message.service.azure.AzureBusService__Autowiring.apply(AzureBusService__Autowiring.java:16)
        at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:83)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
        ... 74 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jmsTemplate': Unsatisfied dependency expressed through method 'jmsTemplate' parameter 0: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveAutowiredArgument(BeanInstanceSupplier.java:345)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:265)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:204)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:188)
        ... 90 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsPoolConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1243)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1180)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
        at org.springframework.beans.factory.support.RegisteredBean.resolveAutowiredArgument(RegisteredBean.java:253)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveAutowiredArgument(BeanInstanceSupplier.java:342)
        ... 105 more
Caused by: java.lang.IllegalStateException: Unable to create JmsConnectionFactory
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryFactory.createConnectionFactoryInstance(ServiceBusJmsConnectionFactoryFactory.java:86)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryFactory.createConnectionFactory(ServiceBusJmsConnectionFactoryFactory.java:43)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryConfiguration.createJmsConnectionFactory(ServiceBusJmsConnectionFactoryConfiguration.java:32)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryConfiguration$PooledConnectionFactoryConfiguration.jmsPoolConnectionFactory(ServiceBusJmsConnectionFactoryConfiguration.java:78)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryConfiguration__BeanDefinitions$PooledConnectionFactoryConfiguration.lambda$getJmsPoolConnectionFactoryInstanceSupplier$1(ServiceBusJmsConnectionFactoryConfiguration__BeanDefinitions.java:54)
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68)
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:206)
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:219)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:206)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:949)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1237)
        ... 118 more
Caused by: java.lang.NoSuchMethodException: com.azure.servicebus.jms.ServiceBusJmsConnectionFactory.<init>(java.lang.String, com.azure.servicebus.jms.ServiceBusJmsConnectionFactorySettings)
        at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1075)
        at [email protected]/java.lang.Class.getConstructor0(DynamicHub.java:1238)
        at [email protected]/java.lang.Class.getConstructor(DynamicHub.java:2442)
        at com.azure.spring.cloud.autoconfigure.implementation.jms.ServiceBusJmsConnectionFactoryFactory.createConnectionFactoryInstance(ServiceBusJmsConnectionFactoryFactory.java:80)
        ... 131 more

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 26, 2024
@khauser khauser changed the title [BUG] [BUG] Azure servicebus has a NoSuchMethodException after native compile Nov 26, 2024
@jeanbisutti jeanbisutti added the graalvm Label for tracking issues related to graalvm label Nov 26, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 26, 2024
@alzimmermsft alzimmermsft added the azure-spring All azure-spring related issues label Nov 26, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 26, 2024
@saragluna saragluna added this to the Backlog milestone Nov 29, 2024
@khauser
Copy link
Author

khauser commented Jan 28, 2025

After upgrading to 5.19.0 I'm getting another error already during ./gradlew bootBuildImage:

2025-01-28T09:03:07.808+01:00  INFO 33128 --- [iste-message] [           main] rocessor$ProxyRegisteringAotContribution : Could not create proxy class for class java.util.concurrent.CompletableFuture (via class com.intershop.iste.message.controller.StorageController). Reason Could not generate CGLIB subclass of class java.util.concurrent.CompletableFuture: Common causes of this problem include using a final class or a non-visible class
Exception in thread "main" java.lang.IllegalStateException: Error processing bean with name 'jmsPoolConnectionFactory': instance supplier is not supported
        at org.springframework.beans.factory.aot.DefaultBeanRegistrationCodeFragments.getTarget(DefaultBeanRegistrationCodeFragments.java:83)
        at org.springframework.beans.factory.aot.BeanDefinitionMethodGenerator.generateBeanDefinitionMethod(BeanDefinitionMethodGenerator.java:85)
        at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$generateRegisterBeanDefinitionsMethod$2(BeanRegistrationsAotContribution.java:90)
        at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
        at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.generateRegisterBeanDefinitionsMethod(BeanRegistrationsAotContribution.java:88)
        at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.lambda$applyTo$1(BeanRegistrationsAotContribution.java:73)
        at org.springframework.aot.generate.GeneratedMethod.<init>(GeneratedMethod.java:54)
        at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:112)
        at org.springframework.aot.generate.GeneratedMethods.add(GeneratedMethods.java:89)
        at org.springframework.beans.factory.aot.BeanRegistrationsAotContribution.applyTo(BeanRegistrationsAotContribution.java:72)
        at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
        at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
        at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
        at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
        at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:106)
        at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
        at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
        at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:81)
        at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:80)```

@khauser
Copy link
Author

khauser commented Jan 28, 2025

Here is a small reproducer:
reproducer.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues customer-reported Issues that are reported by GitHub users external to the Azure organization. graalvm Label for tracking issues related to graalvm needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Todo
Development

No branches or pull requests

4 participants