SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatI

SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatInfo]

SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatI_第1张图片

SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatI_第2张图片

这是什么东东?为何没有见过呢

Reported exception:
java.lang.NoClassDefFoundError: com/alibaba/fastjson/JSON
调用string失败异常

解决方法

出现这个问题首先锁定 com/alibaba/fastjson/JSON ,说明我的pom配置文件出问题了,匹配不到相应的版本类型,我仔细检查了父pom文件内果然没有 SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatI_第3张图片

 <!--2  确定版本-->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <spring-cloud-release.version>Hoxton.SR3</spring-cloud-release.version>
        <nacos.version>1.1.0</nacos.version>
        <alibaba.cloud.version>2.2.1.RELEASE</alibaba.cloud.version>
        <mysql.version>5.1.32</mysql.version>
        <mybatis.plus.version>3.4.0</mybatis.plus.version>
        <druid.starter.version>1.1.9</druid.starter.version>
        <jwt.jjwt.version>0.9.0</jwt.jjwt.version>
        <jwt.joda.version>2.9.7</jwt.joda.version>
        <swagger.version>2.7.0</swagger.version>
        <beanutils.version>1.9.3</beanutils.version>
        <aliyun.sdk.core.version>3.3.1</aliyun.sdk.core.version>
        <aliyun.sdk.dysmsapi.version>1.0.0</aliyun.sdk.dysmsapi.version>
        <changgou4.common.version>1.0-SNAPSHOT</changgou4.common.version>
        <changgou4.common.auth.version>1.0-SNAPSHOT</changgou4.common.auth.version>
        <changgou4.common.db.version>1.0-SNAPSHOT</changgou4.common.db.version>
        <changgou4.pojo.version>1.0-SNAPSHOT</changgou4.pojo.version>

    </properties>

而我的功能模块的子pom文件中也没有相应的版本类型

  <!-- fastjson-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>

所以我们将功能模块的子pom文件里的fastjson加上版本号就解决了

    <!-- fastjson-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.76</version>
        </dependency>

SLF4J: Failed toString() invocation on an object of type [com.alibaba.nacos.client.naming.beat.BeatI_第4张图片
启动成功!!

你可能感兴趣的:(bug)