Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

RabbitMQ : Missing proxy for SimpleMessageListenerContainer #1179

Closed

Description

@olivierboudet

Hello,

I am using spring native 0.11.0-SNAPSHOT (sha1 92c9011) with Spring Boot 2.6.0-RC1.
I declared a bean like this:


@Component
@RequiredArgsConstructor
public class ParametreSiteFlowProcessor {

    @Value("${app.queue}")
    private String queueName;

    @Bean
    public SimpleMessageListenerContainer parametreSiteListenerContainer(MessageListenerFactory messageListenerFactory, ConnectionFactory connectionFactory) {
        SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
        container.setConcurrentConsumers(1);
        container.setPrefetchCount(1);
        container.setQueueNames(Collections.singletonList(queueName);
        return container;
    }

}

It builds fine but I have an error at runtime :

2021-10-24 11:30:08.280 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'parametreSiteListenerContainer': Invocation of init method failed; nested exception is com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer$ContainerDelegate, interface org.springframework.aop.SpringProxy, interface org.springframework.aop.framework.Advised, interface org.springframework.core.DecoratingProxy] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[na:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[na:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[na:na]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[na:na]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[na:na]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[na:na]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[na:na]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[na:na]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[na:na]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[na:na]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[na:na]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:719) ~[com.myproject.MyApplication:2.6.0-RC1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:401) ~[com.myproject.MyApplication:2.6.0-RC1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[com.myproject.MyApplication:2.6.0-RC1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) ~[com.myproject.MyApplication:2.6.0-RC1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1279) ~[com.myproject.MyApplication:2.6.0-RC1]
	at com.myproject.MyApplication.main(MyApplication.java:15) ~[com.myproject.MyApplication:na]
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer$ContainerDelegate, interface org.springframework.aop.SpringProxy, interface org.springframework.aop.framework.Advised, interface org.springframework.core.DecoratingProxy] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) ~[na:na]
	at com.oracle.svm.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:146) ~[na:na]
	at java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:66) ~[com.myproject.MyApplication:na]
	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1006) ~[com.myproject.MyApplication:na]
	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:126) ~[na:na]
	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[na:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.initializeProxy(AbstractMessageListenerContainer.java:1248) ~[na:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.initialize(AbstractMessageListenerContainer.java:1277) ~[na:na]
	at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.afterPropertiesSet(AbstractMessageListenerContainer.java:1208) ~[na:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[na:na]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[na:na]
	... 16 common frames omitted


Activity

  1. added
    status: waiting-for-triage
    on Oct 24, 2021
  2. added this to the 0.11.0-M2 milestone on Oct 24, 2021
  3. added
    type: compatibility
    and removed
    status: waiting-for-triage
    on Oct 24, 2021
  4. self-assigned this
    on Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: compatibility

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions