java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.Module 或者報(bào)錯(cuò)如下
java lang ClassNotFoundException com fasterxml jackson core
一、 出現(xiàn)Jackson相關(guān)的報(bào)錯(cuò)問(wèn)題,由兩個(gè)原因?qū)е?/h2>
一
Jackson-core和jackson-databind和spring-boot-starter-json這三個(gè)依賴(lài)缺少其中的一個(gè)可能無(wú)法正常運(yùn)行
二 檢查依賴(lài)的版本,我今天不光是缺少其中的一個(gè),而且對(duì)著maven倉(cāng)庫(kù)調(diào)整了好幾次版本才找到適配項(xiàng)目的
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.0</version>
</dependency>
<!-- jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.0</version>
</dependency>
<!-- spring-boot-starter-json -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
<version>2.1.7.RELEASE</version>
</dependency>
二、下面介紹一下這三個(gè)依賴(lài)的作用:
Jackson的核心模塊由三部分組成(從Jackson 2.x開(kāi)始):jackson-core、jackson-annotations、jackson-databind。
? jackson-core:核心包,定義了低級(jí)流(Streaming)API,提供基于"流模式"解析。Jackson內(nèi)部實(shí)現(xiàn)正是通過(guò)高性能的流模式API的JsonGenerator和JsonParser來(lái)生成和解析json。
? jackson-annotations,注解(Annotations)包,提供標(biāo)準(zhǔn)的Jackson注解功能;
? jackson-databind:數(shù)據(jù)綁定(Databind)包,實(shí)現(xiàn)了數(shù)據(jù)綁定(和對(duì)象序列化)支持,它依賴(lài)于Streaming和Annotations包。提供基于“對(duì)象綁定”解析的API(ObjectMapper)和"樹(shù)模型"解析的API(JsonNode);基于"對(duì)象綁定"解析的API和"樹(shù)模型"解析的API依賴(lài)基于“流模式”解析的API。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-595936.html
如果要詳細(xì)了解Jackson的功能和用法請(qǐng)參考以下文章
https://developer.aliyun.com/article/848109文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-595936.html
到了這里,關(guān)于使用SparkStreaming時(shí)Jackson報(bào)錯(cuò)java lang ClassNotFoundException com fasterxml jackson core的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!