amqphub / amqp-10-jms-spring-boot

AMQP 1.0 JMS Binding for Spring Boot
Apache License 2.0
34 stars 25 forks source link

GraalVM Native Image fails creating AMQP10JMSConnectionFactoryFactory #14

Open luidoc opened 1 year ago

luidoc commented 1 year ago

AMQP10JMSConnectionFactoryFactory is using reflection to create a connection factory, therefore for example a spring boot application using amqp-10-jms-spring-boot-starter, compiled using Graalvm native image does not run correctly. The library should provide Graal metadata that enables the necessary reflection.

2023-04-20T14:37:53.710+02:00  INFO 1726009 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 34 ms
2023-04-20T14:37:53.720+02:00 ERROR 1726009 --- [           main] .b.j.a.AMQP10JMSConnectionFactoryFactory : Exception while createing the AMQP 1.0 JMS Connection Factory.

java.lang.NoSuchMethodException: org.apache.qpid.jms.JmsConnectionFactory.<init>()

You can see the source code of a example application at https://github.com/luidoc/test-amqp-10-jms.git

tabish121 commented 1 year ago

You example doesn't appear to have any way to run / validate it

luidoc commented 1 year ago

My example:

mvn clean package
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< org.example:test-amqp-10-jms >--------------------
[INFO] Building test-amqp-10-jms 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ test-amqp-10-jms ---
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ test-amqp-10-jms ---
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\desarrollo\test-amqp-10-jms\target\classes
[INFO] 
[INFO] --- resources:3.3.0:testResources (default-testResources) @ test-amqp-10-jms ---
[INFO] skip non existing resourceDirectory C:\desarrollo\test-amqp-10-jms\src\test\resources
[INFO]
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ test-amqp-10-jms ---
[WARNING] Parameter 'systemProperties' is deprecated: Use systemPropertyVariables instead.
[INFO]
[INFO] --- jar:3.3.0:jar (default-jar) @ test-amqp-10-jms ---
[INFO] Building jar: C:\desarrollo\test-amqp-10-jms\target\test-amqp-10-jms-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- spring-boot:3.0.5:repackage (repackage) @ test-amqp-10-jms ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.875 s
[INFO] Finished at: 2023-04-20T18:18:11+02:00
[INFO] ------------------------------------------------------------------------

 java -jar .\target\test-amqp-10-jms-1.0-SNAPSHOT.jar

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

2023-04-20T18:18:50.035+02:00  INFO 17108 --- [           main] org.examples.App                         : Starting App v1.0-SNAPSHOT using Java 19.0.2 with PID 17108 (C:\desarrollo\test-amqp-10-jms\target\test-amqp-10-jms-1.0-SNAPSHOT.jar started by luis in C:\desarrollo\test-amqp-10-jms)
2023-04-20T18:18:50.038+02:00  INFO 17108 --- [           main] org.examples.App                         : No active profile set, falling back to 1 default profile: "default"
2023-04-20T18:18:50.781+02:00  INFO 17108 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-04-20T18:18:50.791+02:00  INFO 17108 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-04-20T18:18:50.791+02:00  INFO 17108 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.7]
2023-04-20T18:18:50.856+02:00  INFO 17108 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-04-20T18:18:50.858+02:00  INFO 17108 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 782 ms
2023-04-20T18:18:51.173+02:00  INFO 17108 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-04-20T18:18:51.186+02:00  INFO 17108 --- [           main] org.examples.App                         : Started App in 1.444 seconds (process running for 1.748)

Native execution, linux:

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

2023-04-20T14:37:53.675+02:00  INFO 1726009 --- [           main] org.examples.App                         : Starting AOT-processed App using Java 19.0.2 with PID 1726009 (/root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms started by root in /root/desarrollo/test-amqp-10-jms)
2023-04-20T14:37:53.676+02:00  INFO 1726009 --- [           main] org.examples.App                         : No active profile set, falling back to 1 default profile: "default"
2023-04-20T14:37:53.699+02:00  INFO 1726009 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8084 (http)
2023-04-20T14:37:53.699+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-04-20T14:37:53.700+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.7]
2023-04-20T14:37:53.710+02:00  INFO 1726009 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-04-20T14:37:53.710+02:00  INFO 1726009 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 34 ms
2023-04-20T14:37:53.720+02:00 ERROR 1726009 --- [           main] .b.j.a.AMQP10JMSConnectionFactoryFactory : Exception while createing the AMQP 1.0 JMS Connection Factory.

java.lang.NoSuchMethodException: org.apache.qpid.jms.JmsConnectionFactory.<init>()
        at java.base@19.0.2/java.lang.Class.getConstructor0(DynamicHub.java:3641) ~[test-amqp-10-jms:na]
        at java.base@19.0.2/java.lang.Class.getConstructor(DynamicHub.java:2324) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:64) ~[na:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration.createQpidJMSConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:94) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration$SimpleConnectionFactoryConfiguration.cachingJmsConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:56) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions$SimpleConnectionFactoryConfiguration__BeanDefinitions.lambda$getJmsConnectionFactoryInstanceSupplier$0(AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions.java:45) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:216) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:327) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:267) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:202) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167) ~[na:na]
        at org.examples.ExampleController__Autowiring.apply(ExampleController__Autowiring.java:14) ~[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) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[test-amqp-10-jms:3.0.5]
        at org.examples.App.main(App.java:11) ~[test-amqp-10-jms:na]

2023-04-20T14:37:53.722+02:00  WARN 1726009 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exampleController': 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 'jmsConnectionFactory': Instantiation of supplied bean failed
2023-04-20T14:37:53.722+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-04-20T14:37:53.723+02:00 ERROR 1726009 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exampleController': 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 'jmsConnectionFactory': Instantiation of supplied bean 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 org.examples.ExampleController__Autowiring.apply(ExampleController__Autowiring.java:14) ~[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) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[test-amqp-10-jms:3.0.5]
        at org.examples.App.main(App.java:11) ~[test-amqp-10-jms:na]
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 'jmsConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:343) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:267) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:202) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
        ... 22 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1220) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:327) ~[na:na]
        ... 37 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to create the AMQP 1.0 JMS ConnectionFactory, make sure the client Jar is on the Classpath.
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:93) ~[na:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration.createQpidJMSConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:94) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration$SimpleConnectionFactoryConfiguration.cachingJmsConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:56) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions$SimpleConnectionFactoryConfiguration__BeanDefinitions.lambda$getJmsConnectionFactoryInstanceSupplier$0(AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions.java:45) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:216) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        ... 48 common frames omitted
Caused by: java.lang.NoSuchMethodException: org.apache.qpid.jms.JmsConnectionFactory.<init>()
        at java.base@19.0.2/java.lang.Class.getConstructor0(DynamicHub.java:3641) ~[test-amqp-10-jms:na]
        at java.base@19.0.2/java.lang.Class.getConstructor(DynamicHub.java:2324) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:64) ~[na:na]
        ... 60 common frames omitted
tabish121 commented 1 year ago

Ran the example using the given " java -jar .\target\test-amqp-10-jms-1.0-SNAPSHOT.jar" and it works without issue, not other details were given on how it is being run to generate the error.

luidoc commented 1 year ago

The error generates when i run the native image, a linux binary created using Graalvm native-image. More info about spring boot native, and how to generete native images on https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html

tabish121 commented 1 year ago

Link doesn't really provide any easy steps for me to follow with the limited time I have to look at this so not much I can do but I'd doubt even if the needed graalvm metadata was added to make the JmsConnectionFactory visible that it would works as Qpid JMS uses extensive refection code under the covers for configuring the client. You could use something like Quarkus Qpid JMS which has the added work to get native mode working along with documentation that shows how to build it in native made.

luidoc commented 1 year ago

You need a Linux machine and install Graalvm from https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java19-linux-amd64-22.3.1.tar.gz Then you need instal native-image, run the following to install it:

[root@fedora]# gu install native-image

Check that your java_home points to the Graalvm installation

[root@fedora]# java -version
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 19.0.2+7-jvmci-22.3-b12)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 19.0.2+7-jvmci-22.3-b12, mixed mode, sharing)

With this, you have everything ready to perform the native compilation.

Now you just have to run maven to do the native build.

[root@fedora]# mvn clean package -Pnative native:compile
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.example:test-amqp-10-jms >--------------------
[INFO] Building test-amqp-10-jms 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ test-amqp-10-jms ---
[INFO] Deleting /root/desarrollo/test-amqp-10-jms/target
[INFO]
[INFO] --- native:0.9.20:add-reachability-metadata (add-reachability-metadata) @ test-amqp-10-jms ---
[INFO] Downloaded GraalVM reachability metadata repository from file:/root/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.9.20/graalvm-reachability-metadata-0.9.20-repository.zip
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory is ch.qos.logback/logback-classic/1.4.1
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory is org.apache.tomcat.embed/tomcat-embed-core/10.0.20
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory is io.netty/netty-buffer/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory is io.netty/netty-common/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory is io.netty/netty-handler/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory is io.netty/netty-transport/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory is io.netty/netty-codec-http/4.1.80.Final
[INFO]
[INFO] --- resources:3.3.0:resources (default-resources) @ test-amqp-10-jms ---
[INFO] Copying 1 resource
[INFO] Copying 6 resources
[INFO]
[INFO] --- compiler:3.10.1:compile (default-compile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /root/desarrollo/test-amqp-10-jms/target/classes
[INFO]
[INFO] --- resources:3.3.0:testResources (default-testResources) @ test-amqp-10-jms ---
[INFO] skip non existing resourceDirectory /root/desarrollo/test-amqp-10-jms/src/test/resources
[INFO]
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ test-amqp-10-jms ---
[WARNING] Parameter 'systemProperties' is deprecated: Use systemPropertyVariables instead.
[INFO]
[INFO] --- spring-boot:3.0.5:process-aot (process-aot) @ test-amqp-10-jms ---

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

2023-04-20T20:42:21.866+02:00  INFO 1784623 --- [           main] org.examples.App                         : Starting App using Java 19.0.2 with PID 1784623 (/root/desarrollo/test-amqp-10-jms/target/classes started by root in /root/desarrollo/test-amqp-10-jms)
2023-04-20T20:42:21.870+02:00  INFO 1784623 --- [           main] org.examples.App                         : No active profile set, falling back to 1 default profile: "default"
[INFO]
[INFO] --- jar:3.3.0:jar (default-jar) @ test-amqp-10-jms ---
[INFO] Building jar: /root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot:3.0.5:repackage (repackage) @ test-amqp-10-jms ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] >>> native:0.9.20:compile (default-cli) > package @ test-amqp-10-jms >>>
[INFO]
[INFO] --- native:0.9.20:add-reachability-metadata (add-reachability-metadata) @ test-amqp-10-jms ---
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory is ch.qos.logback/logback-classic/1.4.1
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory is org.apache.tomcat.embed/tomcat-embed-core/10.0.20
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory is io.netty/netty-buffer/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory is io.netty/netty-common/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory is io.netty/netty-handler/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory is io.netty/netty-transport/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory is io.netty/netty-codec-http/4.1.80.Final
[INFO]
[INFO] --- resources:3.3.0:resources (default-resources) @ test-amqp-10-jms ---
[INFO] Copying 1 resource
[INFO] Copying 6 resources
[INFO]
[INFO] --- compiler:3.10.1:compile (default-compile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /root/desarrollo/test-amqp-10-jms/target/classes
[INFO]
[INFO] --- resources:3.3.0:testResources (default-testResources) @ test-amqp-10-jms ---
[INFO] skip non existing resourceDirectory /root/desarrollo/test-amqp-10-jms/src/test/resources
[INFO]
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ test-amqp-10-jms ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ test-amqp-10-jms ---
[WARNING] Parameter 'systemProperties' is deprecated: Use systemPropertyVariables instead.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO]
[INFO] --- spring-boot:3.0.5:process-aot (process-aot) @ test-amqp-10-jms ---

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

2023-04-20T20:42:26.251+02:00  INFO 1784690 --- [           main] org.examples.App                         : Starting App using Java 19.0.2 with PID 1784690 (/root/desarrollo/test-amqp-10-jms/target/classes started by root in /root/desarrollo/test-amqp-10-jms)
2023-04-20T20:42:26.255+02:00  INFO 1784690 --- [           main] org.examples.App                         : No active profile set, falling back to 1 default profile: "default"
[INFO]
[INFO] --- jar:3.3.0:jar (default-jar) @ test-amqp-10-jms ---
[INFO] Building jar: /root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot:3.0.5:repackage (repackage) @ test-amqp-10-jms ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] <<< native:0.9.20:compile (default-cli) < package @ test-amqp-10-jms <<<
[INFO]
[INFO]
[INFO] --- native:0.9.20:compile (default-cli) @ test-amqp-10-jms ---
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.apache.tomcat.embed:tomcat-embed-core:10.1.7]: Configuration directory is org.apache.tomcat.embed/tomcat-embed-core/10.0.20
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-transport:4.1.90.Final]: Configuration directory is io.netty/netty-transport/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-common:4.1.90.Final]: Configuration directory is io.netty/netty-common/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-buffer:4.1.90.Final]: Configuration directory is io.netty/netty-buffer/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-codec-http:4.1.90.Final]: Configuration directory is io.netty/netty-codec-http/4.1.80.Final
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for io.netty:netty-handler:4.1.90.Final]: Configuration directory is io.netty/netty-handler/4.1.80.Final
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for ch.qos.logback:logback-classic:1.4.6]: Configuration directory is ch.qos.logback/logback-classic/1.4.1
[INFO] Executing: /usr/lib/jvm/graalvm/bin/native-image -cp /root/desarrollo/test-amqp-10-jms/target/classes:/root/.m2/repository/org/springframework/spring-jcl/6.0.7/spring-jcl-6.0.7.jar:/root/.m2/repository/org/springframework/spring-web/6.0.7/spring-web-6.0.7.jar:/root/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.0.5/spring-boot-autoconfigure-3.0.5.jar:/root/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/10.1.7/tomcat-embed-core-10.1.7.jar:/root/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.14.2/jackson-datatype-jsr310-2.14.2.jar:/root/.m2/repository/org/springframework/spring-aop/6.0.7/spring-aop-6.0.7.jar:/root/.m2/repository/io/netty/netty-transport-native-unix-common/4.1.90.Final/netty-transport-native-unix-common-4.1.90.Final.jar:/root/.m2/repository/jakarta/jms/jakarta.jms-api/3.1.0/jakarta.jms-api-3.1.0.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/3.0.5/spring-boot-starter-tomcat-3.0.5.jar:/root/.m2/repository/org/slf4j/jul-to-slf4j/2.0.7/jul-to-slf4j-2.0.7.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.14.2/jackson-databind-2.14.2.jar:/root/.m2/repository/org/springframework/spring-expression/6.0.7/spring-expression-6.0.7.jar:/root/.m2/repository/org/springframework/spring-core/6.0.7/spring-core-6.0.7.jar:/root/.m2/repository/org/amqphub/spring/amqp-10-jms-spring-boot-autoconfigure/3.0.3/amqp-10-jms-spring-boot-autoconfigure-3.0.3.jar:/root/.m2/repository/io/netty/netty-transport/4.1.90.Final/netty-transport-4.1.90.Final.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter/3.0.5/spring-boot-starter-3.0.5.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar:/root/.m2/repository/org/springframework/spring-messaging/6.0.7/spring-messaging-6.0.7.jar:/root/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.90.Final/netty-transport-native-kqueue-4.1.90.Final-osx-x86_64.jar:/root/.m2/repository/io/netty/netty-codec/4.1.90.Final/netty-codec-4.1.90.Final.jar:/root/.m2/repository/org/apache/qpid/proton-j/0.34.0/proton-j-0.34.0.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar:/root/.m2/repository/io/netty/netty-resolver/4.1.90.Final/netty-resolver-4.1.90.Final.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.0.5/spring-boot-starter-logging-3.0.5.jar:/root/.m2/repository/org/springframework/spring-context/6.0.7/spring-context-6.0.7.jar:/root/.m2/repository/org/amqphub/spring/amqp-10-jms-spring-boot-starter/3.0.3/amqp-10-jms-spring-boot-starter-3.0.3.jar:/root/.m2/repository/org/slf4j/slf4j-api/2.0.7/slf4j-api-2.0.7.jar:/root/.m2/repository/io/netty/netty-common/4.1.90.Final/netty-common-4.1.90.Final.jar:/root/.m2/repository/io/netty/netty-transport-classes-kqueue/4.1.90.Final/netty-transport-classes-kqueue-4.1.90.Final.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-web/3.0.5/spring-boot-starter-web-3.0.5.jar:/root/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/10.1.7/tomcat-embed-el-10.1.7.jar:/root/.m2/repository/io/netty/netty-buffer/4.1.90.Final/netty-buffer-4.1.90.Final.jar:/root/.m2/repository/org/springframework/spring-jms/6.0.7/spring-jms-6.0.7.jar:/root/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/root/.m2/repository/io/micrometer/micrometer-commons/1.10.5/micrometer-commons-1.10.5.jar:/root/.m2/repository/io/netty/netty-codec-http/4.1.90.Final/netty-codec-http-4.1.90.Final.jar:/root/.m2/repository/org/springframework/spring-tx/6.0.7/spring-tx-6.0.7.jar:/root/.m2/repository/io/netty/netty-transport-classes-epoll/4.1.90.Final/netty-transport-classes-epoll-4.1.90.Final.jar:/root/.m2/repository/ch/qos/logback/logback-core/1.4.6/logback-core-1.4.6.jar:/root/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.14.2/jackson-datatype-jdk8-2.14.2.jar:/root/.m2/repository/io/netty/netty-transport-native-epoll/4.1.90.Final/netty-transport-native-epoll-4.1.90.Final-linux-x86_64.jar:/root/.m2/repository/org/springframework/spring-webmvc/6.0.7/spring-webmvc-6.0.7.jar:/root/.m2/repository/org/springframework/boot/spring-boot/3.0.5/spring-boot-3.0.5.jar:/root/.m2/repository/io/micrometer/micrometer-observation/1.10.5/micrometer-observation-1.10.5.jar:/root/.m2/repository/org/springframework/spring-beans/6.0.7/spring-beans-6.0.7.jar:/root/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.14.2/jackson-module-parameter-names-2.14.2.jar:/root/.m2/repository/org/springframework/boot/spring-boot-starter-json/3.0.5/spring-boot-starter-json-3.0.5.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.19.0/log4j-to-slf4j-2.19.0.jar:/root/.m2/repository/io/netty/netty-handler/4.1.90.Final/netty-handler-4.1.90.Final.jar:/root/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar:/root/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar:/root/.m2/repository/org/apache/qpid/qpid-jms-client/2.2.0/qpid-jms-client-2.2.0.jar:/root/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.7/tomcat-embed-websocket-10.1.7.jar:/root/.m2/repository/ch/qos/logback/logback-classic/1.4.6/logback-classic-1.4.6.jar --no-fallback -H:Path=/root/desarrollo/test-amqp-10-jms/target -H:Name=test-amqp-10-jms -H:ConfigurationFileDirectories=/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/io.netty/netty-codec-http/4.1.80.Final,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/org.apache.tomcat.embed/tomcat-embed-core/10.0.20,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/io.netty/netty-transport/4.1.80.Final,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/io.netty/netty-handler/4.1.80.Final,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/io.netty/netty-buffer/4.1.80.Final,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/ch.qos.logback/logback-classic/1.4.1,/root/desarrollo/test-amqp-10-jms/target/graalvm-reachability-metadata/21936a60feb6717e6ae02390f60b4704ef21c1ea/io.netty/netty-common/4.1.80.Final --exclude-config \Q/root/.m2/repository/io/netty/netty-transport/4.1.90.Final/netty-transport-4.1.90.Final.jar\E ^/META-INF/native-image/ --exclude-config \Q/root/.m2/repository/io/netty/netty-common/4.1.90.Final/netty-common-4.1.90.Final.jar\E ^/META-INF/native-image/ --exclude-config \Q/root/.m2/repository/io/netty/netty-buffer/4.1.90.Final/netty-buffer-4.1.90.Final.jar\E ^/META-INF/native-image/ --exclude-config \Q/root/.m2/repository/io/netty/netty-codec-http/4.1.90.Final/netty-codec-http-4.1.90.Final.jar\E ^/META-INF/native-image/ --exclude-config \Q/root/.m2/repository/io/netty/netty-handler/4.1.90.Final/netty-handler-4.1.90.Final.jar\E ^/META-INF/native-image/
========================================================================================================================
GraalVM Native Image: Generating 'test-amqp-10-jms' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                    (9,6s @ 0,29GB)
 Version info: 'GraalVM 22.3.1 Java 19 CE'
 Java version info: '19.0.2+7-jvmci-22.3-b12'
 C compiler: gcc (redhat, x86_64, 11.3.1)
 Garbage collector: Serial GC
 1 user-specific feature(s)
 - org.springframework.aot.nativex.feature.PreComputeFieldFeature
Field org.apache.commons.logging.LogAdapter#log4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#log4jSlf4jProviderPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jApiPresent set to true at build time
Field org.springframework.core.NativeDetector#imageCode set to true at build time
Field org.springframework.core.KotlinDetector#kotlinPresent set to false at build time
Field org.springframework.core.KotlinDetector#kotlinReflectPresent set to false at build time
Field org.springframework.format.support.DefaultFormattingConversionService#jsr354Present set to false at build time
Field org.springframework.cglib.core.AbstractClassGenerator#imageCode set to true at build time
Field org.springframework.http.converter.json.Jackson2ObjectMapperBuilder#jackson2XmlPresent set to false at build time
Field org.springframework.web.servlet.view.InternalResourceViewResolver#jstlPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#romePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jaxb2Present set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2Present set to true at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2XmlPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2SmilePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2CborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#gsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jsonbPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.boot.autoconfigure.web.format.WebConversionService#JSR_354_PRESENT set to false at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.boot.logging.java.JavaLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.boot.logging.log4j2.Log4J2LoggingSystem$Factory#PRESENT set to false at build time
Field org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#jndiPresent set to true at build time
Field org.springframework.web.client.RestTemplate#romePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jaxb2Present set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2Present set to true at build time
Field org.springframework.web.client.RestTemplate#jackson2XmlPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2SmilePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2CborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#gsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jsonbPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jaxb2Present set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2Present set to true at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2XmlPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2SmilePresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#gsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jsonbPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationCborPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.web.context.support.StandardServletEnvironment#jndiPresent set to true at build time
Field org.springframework.web.context.support.WebApplicationContextUtils#jsfPresent set to false at build time
Field org.springframework.web.context.request.RequestContextHolder#jsfPresent set to false at build time
Field org.springframework.context.event.ApplicationListenerMethodAdapter#reactiveStreamsPresent set to false at build time
Field org.springframework.context.annotation.AnnotationConfigUtils#jakartaAnnotationsPresent set to true at build time
Field org.springframework.context.annotation.AnnotationConfigUtils#jsr250Present set to false at build time
Field org.springframework.context.annotation.AnnotationConfigUtils#jpaPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#reactorPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#rxjava3Present set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#kotlinCoroutinesPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#mutinyPresent set to false at build time
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Field org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler#isContextPropagationPresent set to false at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystemProperties#JBOSS_LOGGING_PRESENT set to false at build time
Field org.springframework.web.servlet.support.RequestContext#jstlPresent set to false at build time
[2/7] Performing analysis...  [*********]                                                               (45,6s @ 2,88GB)
  16.617 (90,71%) of 18.318 classes reachable
  26.724 (68,11%) of 39.239 fields reachable
  79.643 (62,19%) of 128.055 methods reachable
   1.225 classes, 1.066 fields, and 6.925 methods registered for reflection
      63 classes,    70 fields, and    55 methods registered for JNI access
       4 native libraries: dl, pthread, rt, z
[3/7] Building universe...                                                                               (5,7s @ 1,99GB)
[4/7] Parsing methods...      [**]                                                                       (3,1s @ 3,07GB)
[5/7] Inlining methods...     [****]                                                                     (1,9s @ 1,69GB)
[6/7] Compiling methods...    [****]                                                                    (17,7s @ 2,50GB)
[7/7] Creating image...                                                                                  (9,1s @ 4,77GB)
  35,41MB (51,66%) for code area:    52.358 compilation units
  32,81MB (47,87%) for image heap:  372.002 objects and 278 resources
 329,62KB ( 0,47%) for other data
  68,54MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
   1,69MB sun.security.ssl                                     7,80MB byte[] for code metadata
   1,08MB java.util                                            3,95MB java.lang.Class
 843,01KB java.lang.invoke                                     3,65MB java.lang.String
 724,31KB com.sun.crypto.provider                              3,10MB byte[] for java.lang.String
 570,70KB org.apache.catalina.core                             2,93MB byte[] for general heap data
 506,57KB java.util.concurrent                                 1,55MB byte[] for embedded resources
 503,55KB org.apache.tomcat.util.net                           1,39MB com.oracle.svm.core.hub.DynamicHubCompanion
 491,07KB org.apache.coyote.http2                              1,08MB byte[] for reflection metadata
 478,27KB sun.security.x509                                  712,28KB java.lang.String[]
 475,06KB java.lang                                          585,16KB c.o.svm.core.hub.DynamicHub$ReflectionMetadata
  27,77MB for 690 more packages                                5,54MB for 3237 more object types
------------------------------------------------------------------------------------------------------------------------
                        4,5s (4,3% of total time) in 38 GCs | Peak RSS: 6,68GB | CPU load: 7,75
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms (executable)
 /root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms.build_artifacts.txt (txt)
========================================================================================================================
Finished generating 'test-amqp-10-jms' in 1m 43s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:56 min
[INFO] Finished at: 2023-04-20T20:44:14+02:00
[INFO] ------------------------------------------------------------------------

This generates a linux executable binary, as you can see

[root@fedora]# ls target/
classes  generated-sources  generated-test-sources  graalvm-reachability-metadata  maven-archiver  maven-status  spring-aot  test-amqp-10-jms  test-amqp-10-jms-1.0-SNAPSHOT.jar  test-amqp-10-jms-1.0-SNAPSHOT.jar.original  test-amqp-10-jms.build_artifacts.txt  test-classes

The binary file is test-amqp-10-jms. Finally you run this binary and get the error that I indicated in note 3:

[root@fedora]# ./target/test-amqp-10-jms

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

2023-04-20T14:37:53.675+02:00  INFO 1726009 --- [           main] org.examples.App                         : Starting AOT-processed App using Java 19.0.2 with PID 1726009 (/root/desarrollo/test-amqp-10-jms/target/test-amqp-10-jms started by root in /root/desarrollo/test-amqp-10-jms)
2023-04-20T14:37:53.676+02:00  INFO 1726009 --- [           main] org.examples.App                         : No active profile set, falling back to 1 default profile: "default"
2023-04-20T14:37:53.699+02:00  INFO 1726009 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8084 (http)
2023-04-20T14:37:53.699+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-04-20T14:37:53.700+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.7]
2023-04-20T14:37:53.710+02:00  INFO 1726009 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-04-20T14:37:53.710+02:00  INFO 1726009 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 34 ms
2023-04-20T14:37:53.720+02:00 ERROR 1726009 --- [           main] .b.j.a.AMQP10JMSConnectionFactoryFactory : Exception while createing the AMQP 1.0 JMS Connection Factory.

java.lang.NoSuchMethodException: org.apache.qpid.jms.JmsConnectionFactory.<init>()
        at java.base@19.0.2/java.lang.Class.getConstructor0(DynamicHub.java:3641) ~[test-amqp-10-jms:na]
        at java.base@19.0.2/java.lang.Class.getConstructor(DynamicHub.java:2324) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:64) ~[na:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration.createQpidJMSConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:94) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration$SimpleConnectionFactoryConfiguration.cachingJmsConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:56) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions$SimpleConnectionFactoryConfiguration__BeanDefinitions.lambda$getJmsConnectionFactoryInstanceSupplier$0(AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions.java:45) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:216) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:327) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:267) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:202) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:167) ~[na:na]
        at org.examples.ExampleController__Autowiring.apply(ExampleController__Autowiring.java:14) ~[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) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[test-amqp-10-jms:3.0.5]
        at org.examples.App.main(App.java:11) ~[test-amqp-10-jms:na]

2023-04-20T14:37:53.722+02:00  WARN 1726009 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exampleController': 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 'jmsConnectionFactory': Instantiation of supplied bean failed
2023-04-20T14:37:53.722+02:00  INFO 1726009 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-04-20T14:37:53.723+02:00 ERROR 1726009 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exampleController': 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 'jmsConnectionFactory': Instantiation of supplied bean 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 org.examples.ExampleController__Autowiring.apply(ExampleController__Autowiring.java:14) ~[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) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[test-amqp-10-jms:3.0.5]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[test-amqp-10-jms:3.0.5]
        at org.examples.App.main(App.java:11) ~[test-amqp-10-jms:na]
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 'jmsConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:343) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArguments(BeanInstanceSupplier.java:267) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:202) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:189) ~[na:na]
        ... 22 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory': Instantiation of supplied bean failed
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1220) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1158) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.resolveArgument(BeanInstanceSupplier.java:327) ~[na:na]
        ... 37 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to create the AMQP 1.0 JMS ConnectionFactory, make sure the client Jar is on the Classpath.
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:93) ~[na:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration.createQpidJMSConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:94) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration$SimpleConnectionFactoryConfiguration.cachingJmsConnectionFactory(AMQP10JMSConnectionFactoryConfiguration.java:56) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions$SimpleConnectionFactoryConfiguration__BeanDefinitions.lambda$getJmsConnectionFactoryInstanceSupplier$0(AMQP10JMSConnectionFactoryConfiguration__BeanDefinitions.java:45) ~[na:na]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$2(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:216) ~[na:na]
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:204) ~[na:na]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:947) ~[test-amqp-10-jms:6.0.7]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1214) ~[test-amqp-10-jms:6.0.7]
        ... 48 common frames omitted
Caused by: java.lang.NoSuchMethodException: org.apache.qpid.jms.JmsConnectionFactory.<init>()
        at java.base@19.0.2/java.lang.Class.getConstructor0(DynamicHub.java:3641) ~[test-amqp-10-jms:na]
        at java.base@19.0.2/java.lang.Class.getConstructor(DynamicHub.java:2324) ~[test-amqp-10-jms:na]
        at org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryFactory.createConnectionFactory(AMQP10JMSConnectionFactoryFactory.java:64) ~[na:na]
        ... 60 common frames omitted
luidoc commented 1 year ago

I am perfectly aware of the option to use Quarkus, but what I would need is for this library (https://github.com/amqphub/amqp-10-jms-spring-boot) to work for spring boot native as well, without the need to create custom hints or other workarounds.

tabish121 commented 1 year ago

With the info provided I was able to build and reproduce the issue. I went ahead and created a reflect-config.json that gets you past the initial problem but as I expected you just run into other issue as Qpid JMS doesn't support being built as a native mode library so you just get different errors as it tries to start. I don't see there being scope to try and figure out how to add enough configuration here to get it working. Contributions are welcome.

luidoc commented 1 year ago

As an initial workaround, I've added this annotation, @RegisterReflectionForBinding({JmsTemplate.class, JmsConnectionFactory.class}), to the App class and for this simple example it works.

On the other hand, I have used the Tracing Agent (https://www.graalvm.org/22.0/reference-manual/native-image/Agent/) in a more complex project, which uses amqp-10-jms-spring-boot -starter, and I have this from the reflect-config.json file that is generated:


{
  "name":"org.apache.qpid.jms.JmsConnectionFactory",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"<init>","parameterTypes":[] }, 
    {"name":"getClientID","parameterTypes":[] }, 
    {"name":"getClientIDPrefix","parameterTypes":[] }, 
    {"name":"getCloseTimeout","parameterTypes":[] }, 
    {"name":"getConnectTimeout","parameterTypes":[] }, 
    {"name":"getDeserializationPolicy","parameterTypes":[] }, 
    {"name":"getExceptionListener","parameterTypes":[] }, 
    {"name":"getMessageIDPolicy","parameterTypes":[] }, 
    {"name":"getPassword","parameterTypes":[] }, 
    {"name":"getPrefetchPolicy","parameterTypes":[] }, 
    {"name":"getPresettlePolicy","parameterTypes":[] }, 
    {"name":"getQueuePrefix","parameterTypes":[] }, 
    {"name":"getRedeliveryPolicy","parameterTypes":[] }, 
    {"name":"getRemoteURI","parameterTypes":[] }, 
    {"name":"getRequestTimeout","parameterTypes":[] }, 
    {"name":"getSendTimeout","parameterTypes":[] }, 
    {"name":"getTopicPrefix","parameterTypes":[] }, 
    {"name":"getTracer","parameterTypes":[] }, 
    {"name":"getTracing","parameterTypes":[] }, 
    {"name":"getUsername","parameterTypes":[] }, 
    {"name":"isAwaitClientID","parameterTypes":[] }, 
    {"name":"isCloseLinksThatFailOnReconnect","parameterTypes":[] }, 
    {"name":"isForceAsyncAcks","parameterTypes":[] }, 
    {"name":"isForceAsyncSend","parameterTypes":[] }, 
    {"name":"isForceSyncSend","parameterTypes":[] }, 
    {"name":"isLocalMessageExpiry","parameterTypes":[] }, 
    {"name":"isLocalMessagePriority","parameterTypes":[] }, 
    {"name":"isPopulateJMSXUserID","parameterTypes":[] }, 
    {"name":"isReceiveLocalOnly","parameterTypes":[] }, 
    {"name":"isReceiveNoWaitLocalOnly","parameterTypes":[] }, 
    {"name":"isUseDaemonThread","parameterTypes":[] }, 
    {"name":"isValidatePropertyNames","parameterTypes":[] }, 
    {"name":"isValidateSelector","parameterTypes":[] }, 
    {"name":"setClientID","parameterTypes":["java.lang.String"] }
  ]
},
{
  "name":"org.apache.qpid.jms.jndi.JNDIStorable",
  "queryAllPublicMethods":true
},
{
  "name":"org.apache.qpid.jms.message.JmsMessageIDBuilder",
  "methods":[
    {"name":"createMessageID","parameterTypes":["java.lang.String","long"] }, 
    {"name":"initialize","parameterTypes":["java.lang.String"] }
  ]
},
{
  "name":"org.apache.qpid.jms.message.JmsMessageIDBuilder$BUILTIN$1$1",
  "queryAllPublicMethods":true
},
{
  "name":"org.apache.qpid.jms.meta.JmsAbstractResource",
  "queryAllPublicMethods":true
},
{
  "name":"org.apache.qpid.jms.meta.JmsConnectionInfo",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"getDeserializationPolicy","parameterTypes":[] }, 
    {"name":"getMessageIDPolicy","parameterTypes":[] }, 
    {"name":"getPrefetchPolicy","parameterTypes":[] }, 
    {"name":"getPresettlePolicy","parameterTypes":[] }, 
    {"name":"getRedeliveryPolicy","parameterTypes":[] }, 
    {"name":"setAwaitClientID","parameterTypes":["boolean"] }, 
    {"name":"setCloseLinksThatFailOnReconnect","parameterTypes":["boolean"] }, 
    {"name":"setCloseTimeout","parameterTypes":["long"] }, 
    {"name":"setConnectTimeout","parameterTypes":["long"] }, 
    {"name":"setForceAsyncAcks","parameterTypes":["boolean"] }, 
    {"name":"setForceAsyncSend","parameterTypes":["boolean"] }, 
    {"name":"setForceSyncSend","parameterTypes":["boolean"] }, 
    {"name":"setLocalMessageExpiry","parameterTypes":["boolean"] }, 
    {"name":"setLocalMessagePriority","parameterTypes":["boolean"] }, 
    {"name":"setPassword","parameterTypes":["java.lang.String"] }, 
    {"name":"setPopulateJMSXUserID","parameterTypes":["boolean"] }, 
    {"name":"setReceiveLocalOnly","parameterTypes":["boolean"] }, 
    {"name":"setReceiveNoWaitLocalOnly","parameterTypes":["boolean"] }, 
    {"name":"setRequestTimeout","parameterTypes":["long"] }, 
    {"name":"setSendTimeout","parameterTypes":["long"] }, 
    {"name":"setUseDaemonThread","parameterTypes":["boolean"] }, 
    {"name":"setUsername","parameterTypes":["java.lang.String"] }, 
    {"name":"setValidatePropertyNames","parameterTypes":["boolean"] }, 
    {"name":"setValidateSelector","parameterTypes":["boolean"] }
  ]
},
{
  "name":"org.apache.qpid.jms.policy.JmsDefaultDeserializationPolicy",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"getAllowList","parameterTypes":[] }, 
    {"name":"getBlackList","parameterTypes":[] }, 
    {"name":"getDenyList","parameterTypes":[] }, 
    {"name":"getWhiteList","parameterTypes":[] }, 
    {"name":"setAllowList","parameterTypes":["java.lang.String"] }, 
    {"name":"setBlackList","parameterTypes":["java.lang.String"] }, 
    {"name":"setDenyList","parameterTypes":["java.lang.String"] }, 
    {"name":"setWhiteList","parameterTypes":["java.lang.String"] }
  ]
},
{
  "name":"org.apache.qpid.jms.policy.JmsDefaultMessageIDPolicy",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"getMessageIDBuilder","parameterTypes":[] }, 
    {"name":"getMessageIDType","parameterTypes":[] }, 
    {"name":"setMessageIDType","parameterTypes":["java.lang.String"] }
  ]
},
{
  "name":"org.apache.qpid.jms.policy.JmsDefaultPrefetchPolicy",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"getDurableTopicPrefetch","parameterTypes":[] }, 
    {"name":"getMaxPrefetchSize","parameterTypes":[] }, 
    {"name":"getQueueBrowserPrefetch","parameterTypes":[] }, 
    {"name":"getQueuePrefetch","parameterTypes":[] }, 
    {"name":"getTopicPrefetch","parameterTypes":[] }, 
    {"name":"setDurableTopicPrefetch","parameterTypes":["int"] }, 
    {"name":"setMaxPrefetchSize","parameterTypes":["int"] }, 
    {"name":"setQueueBrowserPrefetch","parameterTypes":["int"] }, 
    {"name":"setQueuePrefetch","parameterTypes":["int"] }, 
    {"name":"setTopicPrefetch","parameterTypes":["int"] }
  ]
},
{
  "name":"org.apache.qpid.jms.policy.JmsDefaultPresettlePolicy",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"isPresettleAll","parameterTypes":[] }, 
    {"name":"isPresettleConsumers","parameterTypes":[] }, 
    {"name":"isPresettleProducers","parameterTypes":[] }, 
    {"name":"isPresettleQueueConsumers","parameterTypes":[] }, 
    {"name":"isPresettleQueueProducers","parameterTypes":[] }, 
    {"name":"isPresettleTopicConsumers","parameterTypes":[] }, 
    {"name":"isPresettleTopicProducers","parameterTypes":[] }, 
    {"name":"isPresettleTransactedProducers","parameterTypes":[] }, 
    {"name":"setPresettleAll","parameterTypes":["boolean"] }, 
    {"name":"setPresettleConsumers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleProducers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleQueueConsumers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleQueueProducers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleTopicConsumers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleTopicProducers","parameterTypes":["boolean"] }, 
    {"name":"setPresettleTransactedProducers","parameterTypes":["boolean"] }
  ]
},
{
  "name":"org.apache.qpid.jms.policy.JmsDefaultRedeliveryPolicy",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"getMaxRedeliveries","parameterTypes":[] }, 
    {"name":"getOutcome","parameterTypes":[] }, 
    {"name":"setMaxRedeliveries","parameterTypes":["int"] }, 
    {"name":"setOutcome","parameterTypes":["int"] }
  ]
},
{
  "name":"org.apache.qpid.jms.provider.amqp.AmqpProviderFactory",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"<init>","parameterTypes":[] }, 
    {"name":"setProviderScheme","parameterTypes":["java.lang.String"] }, 
    {"name":"setTransportScheme","parameterTypes":["java.lang.String"] }
  ]
},
{
  "name":"org.apache.qpid.jms.provider.failover.FailoverProvider",
  "queryAllPublicMethods":true,
  "methods":[
    {"name":"setMaxReconnectAttempts","parameterTypes":["int"] }, 
    {"name":"setRandomize","parameterTypes":["boolean"] }
  ]
},
{
  "name":"org.apache.qpid.jms.provider.failover.FailoverProviderFactory",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.apache.qpid.jms.sasl.AnonymousMechanismFactory",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.apache.qpid.jms.sasl.PlainMechanismFactory",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.apache.qpid.jms.transports.netty.NettyTcpTransport$1"
},
{
  "name":"org.apache.qpid.jms.transports.netty.NettyTcpTransport$NettyDefaultHandler",
  "methods":[
    {"name":"channelActive","parameterTypes":["io.netty.channel.ChannelHandlerContext"] }, 
    {"name":"channelInactive","parameterTypes":["io.netty.channel.ChannelHandlerContext"] }, 
    {"name":"channelRegistered","parameterTypes":["io.netty.channel.ChannelHandlerContext"] }, 
    {"name":"exceptionCaught","parameterTypes":["io.netty.channel.ChannelHandlerContext","java.lang.Throwable"] }
  ]
},
{
  "name":"org.apache.qpid.jms.transports.netty.NettyTcpTransport$NettyTcpTransportHandler"
},
{
  "name":"org.apache.qpid.jms.transports.netty.NettyTcpTransportFactory",
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSAutoConfiguration",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true,
  "queryAllDeclaredConstructors":true,
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSAutoConfiguration$$SpringCGLIB$$0",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true,
  "queryAllDeclaredConstructors":true,
  "fields":[{"name":"CGLIB$FACTORY_DATA"}],
  "methods":[
    {"name":"<init>","parameterTypes":[] }, 
    {"name":"CGLIB$SET_STATIC_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }, 
    {"name":"CGLIB$SET_THREAD_CALLBACKS","parameterTypes":["org.springframework.cglib.proxy.Callback[]"] }
  ]
},
{
  "name":"org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true,
  "queryAllDeclaredConstructors":true,
  "methods":[{"name":"<init>","parameterTypes":[] }]
},
{
  "name":"org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSConnectionFactoryConfiguration$SimpleConnectionFactoryConfiguration",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true,
  "queryAllDeclaredConstructors":true,
  "methods":[
    {"name":"<init>","parameterTypes":[] }, 
    {"name":"cachingJmsConnectionFactory","parameterTypes":["org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSProperties","org.springframework.beans.factory.ObjectProvider","org.springframework.boot.autoconfigure.jms.JmsProperties"] }
  ]
},
{
  "name":"org.amqphub.spring.boot.jms.autoconfigure.AMQP10JMSProperties",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true,
  "queryAllDeclaredConstructors":true,
  "methods":[
    {"name":"<init>","parameterTypes":[] }, 
    {"name":"setPassword","parameterTypes":["java.lang.String"] }, 
    {"name":"setRemoteUrl","parameterTypes":["java.lang.String"] }, 
    {"name":"setUsername","parameterTypes":["java.lang.String"] }
  ]
},
tabish121 commented 1 year ago

I added a basic reflect config as a start that gets your simple example to build and run without an error. I did not actually test client functionality

tabish121 commented 1 year ago

I updated the reflection config and added resource config which now allows me to start a sample spring boot project build into a native image and connect to a broker. The application ultimately fails though due to spring boot trying to create a proxy that cannot be done in native applications and I can't figure out how to stop it doing that or configure it to work (proxybeanmethods = false) didn't work.