Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-4245

ServiceActivatorAnnotationPostProcessor$ReplyProducingMessageHandlerWrapper is not public

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.8
    • Fix Version/s: 5.0 M5
    • Component/s: JMX Support
    • Labels:

      Description

      During start of Spring Boot App Spring is trying to auto-detect beans to JMX exposure and since ReplyProducingMessageHandlerWrapper is marked by @ManageResource, all beans wrapped by ReplyProducingMessageHandlerWrapper are suitable for that.
      For examle:

      Bar.java
      @Bean
      @ServiceActivator(inputChannel = "avaloqFileOutputChannel", outputChannel = "nullChannel")
      public MessageHandler avaloqResultsHandler(SessionFactory<ChannelSftp.LsEntry> sftpSessionFactory,
                                                 @Value("${avaloq.sftp.path.remote}") String remoteDir,
                                                 @Value("${avaloq.sftp.resFileNameFormat}") String resFileNameFormat) {
          FileTransferringMessageHandler<ChannelSftp.LsEntry> handler = new FileTransferringMessageHandler<>(sftpSessionFactory);
          handler.setRemoteDirectoryExpression(new LiteralExpression(remoteDir));
          handler.setFileNameGenerator(message -> String.format(resFileNameFormat, new Date()));
          return handler;
      }
      

      But AnnotationJmxAttributeSource (spring-core 4.3.3) checks managed resource is public (line 72), and throws exception in case managed resource is ReplyProducingMessageHandlerWrapper:

      2017-03-22T16:12:57,968 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
      org.springframework.jmx.export.metadata.InvalidMetadataException: @ManagedResource class 'org.springframework.integration.config.annotation.ServiceActivatorAnnotationPostProcessor$ReplyProducingMessageHandlerWrapper' must be public
                      at org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource.getManagedResource(AnnotationJmxAttributeSource.java:72) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler.includeBean(MetadataMBeanInfoAssembler.java:121) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.MBeanExporter$1.include(MBeanExporter.java:868) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:903) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:865) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:544) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.jmx.export.MBeanExporter.afterSingletonsInstantiated(MBeanExporter.java:432) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:771) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
                      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
                      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
                      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
                      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
                      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
                      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            niklatyshev Nikolay Latyshev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: