Skip to content

Component name with colon is unsupported in JDK 11 - Unable to register MBean - Invalid character `:' in value #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StephanPraetsch opened this issue Nov 5, 2021 · 2 comments

Comments

@StephanPraetsch
Copy link

StephanPraetsch commented Nov 5, 2021

Hi,

for JDK 11 a component name must not contain a colon, see here. But the getComponentType() produces a name with colon. For instance

    @Bean("blubb")
    public IntegrationFlow blubb() {
        return IntegrationFlows.from(sqsMessageDrivenChannelAdapter())
                .route(headerRouter())
                .get();
    }

creates blubb.aws:sqs-message-driven-channel-adapter#0.

A fix might be to replace the colon by a dot, like StephanPraetsch#2 (sorry, I don't know how to target my pull request to your repository)

spring-projects/spring-integration#3051 might describe the same issue but I'm uncertain if it's really the same.

@artembilan
Copy link
Member

Yes, that sounds like fully related to your problem.
See if adding this dependency fixes it for you:

        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-jmx</artifactId>
        </dependency>

Exactly same we discuss in the mentioned issue in Spring Integration.

I don't think that just regular JMX guarantees a fix like you suggest: better to discuss the fix in the Spring Framework: spring-projects/spring-framework#23608

@StephanPraetsch StephanPraetsch changed the title Component name with colon is unsupported in JDK 11 Component name with colon is unsupported in JDK 11 - Unable to register MBean - Invalid character `:' in value Nov 5, 2021
@StephanPraetsch
Copy link
Author

Wow, what a quick response. That fix really helps, thanks a lot.
So there are 3 reported issues now. In spring-framework, spring-integration and here. Alright, I close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants