spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

【spring-cloud-starter-stream-rocketmq】fastjson leads to CamelCase1x.

Open guoshiqiufeng opened this issue 1 year ago • 0 comments

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。 We recommend using English. If you are non-native English speaker, you can use the translation software. We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly.

Which Component eg. spring-cloud-starter-stream-rocketmq

Describe the bug Project dependencies:

  • springboot 3.2.4
  • springcloud 2023.0.1
  • spring-cloud-alibaba 2023.0.1.2

Create a simple springboot project, pom.xml add the following dependencies

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

Starting a springboot project reports an error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sendController': Unsatisfied dependency expressed through field 'streamBridge': Error creating bean with name 'streamBridgeUtils' defined in class path resource [org/springframework/cloud/stream/function/FunctionConfiguration.class]: Unsatisfied dependency expressed through method 'streamBridgeUtils' parameter 0: Error creating bean with name 'functionCatalog' defined in class path resource [org/springframework/cloud/function/context/config/ContextFunctionCatalogAutoConfiguration.class]: Unsatisfied dependency expressed through method 'functionCatalog' parameter 0: Error creating bean with name 'com.alibaba.cloud.stream.binder.rocketmq.convert.RocketMQMessageConverter' defined in class path resource [com/alibaba/cloud/stream/binder/rocketmq/autoconfigurate/ExtendedBindingHandlerMappingsProviderConfiguration.class]: Failed to instantiate [org.springframework.messaging.converter.CompositeMessageConverter]: Factory method 'rocketMQMessageConverter' threw exception with message: CamelCase1x

Additional context Exclude the fastjson dependency and introduce the fastjson dependency separately.

<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>fastjson</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.83</version>
        </dependency>

guoshiqiufeng avatar Aug 23 '24 09:08 guoshiqiufeng