国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

org.springframework.data.redis.serializer.SerializationException: Cannot serialize(解決redis存入對(duì)象序列化)

這篇具有很好參考價(jià)值的文章主要介紹了org.springframework.data.redis.serializer.SerializationException: Cannot serialize(解決redis存入對(duì)象序列化)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.InvalidClassException: com.xs.entity.XXX; class invalid for deserialization

	at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.deserialize

在調(diào)用service 實(shí)現(xiàn)類(lèi)時(shí)報(bào)出以上錯(cuò)誤,原因是因?yàn)?spring會(huì)先將對(duì)象序列化,再存入redis進(jìn)行緩存,而entity沒(méi)有實(shí)現(xiàn)序列化接口,因此序列化出錯(cuò),需要在對(duì)應(yīng)的實(shí)體類(lèi)中添加序列化即可(implements Serializable),如下:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-629547.html

@Override
@Cacheable(value = "student")
public Student getStudentById(int id) {
    return studentMapper.getStudentById(id);
}
public class Student implements Serializable{
    private  int id;
    private String name;
    private String fullname;
}

到了這里,關(guān)于org.springframework.data.redis.serializer.SerializationException: Cannot serialize(解決redis存入對(duì)象序列化)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 解決IDEA,Cannot resolve org.springframework.boot,Build報(bào)錯(cuò)的問(wèn)題

    解決IDEA,Cannot resolve org.springframework.boot,Build報(bào)錯(cuò)的問(wèn)題

    原因:可能因?yàn)榫W(wǎng)絡(luò)波動(dòng),導(dǎo)致jar包下載不成功 解決:直接找到對(duì)應(yīng)本地倉(cāng)庫(kù)文件 把Plugins 文件直接刪除(不要怕刪錯(cuò),直接回收站收回),再重啟idea ,確定網(wǎng)絡(luò)通暢,將自動(dòng)重新下載jar包兒?。。?萬(wàn)一不行,建議多試幾次?。。。。。?/p>

    2024年02月16日
    瀏覽(189)
  • springboot配置swagger報(bào)錯(cuò)Cannot invoke “org.springframework.web.servlet.mvc.condition.......”

    springboot配置swagger報(bào)錯(cuò)Cannot invoke “org.springframework.web.servlet.mvc.condition.......”

    springboot配置swagger時(shí)報(bào)錯(cuò),spring boot使用版本為2.7.16或3.1.5,JDK17,項(xiàng)目啟動(dòng)報(bào)錯(cuò),項(xiàng)目使用swagger 3.0. 具體報(bào)錯(cuò)信息如下: swagger導(dǎo)入依賴(lài)如下: 解決方案:在application.yml中引入以下配置: 另外,因?yàn)榘姹静煌?,訪問(wèn)路徑改變和訪問(wèn)的文件名也與之前版本不一致! 直接訪問(wèn)h

    2024年01月22日
    瀏覽(30)
  • No qualifying bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate‘ a

    No qualifying bean of type ‘org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 提示找不到 ElasticsearchRestTemplate 寫(xiě)一個(gè)配置類(lèi)注入

    2024年02月17日
    瀏覽(19)
  • Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin: 解決辦法

    方法一 可能是你的鏡像源的問(wèn)題,查看你的maven安裝目錄下的 conf/setting.xml 的鏡像源是否是國(guó)外地址還是說(shuō)國(guó)內(nèi)的一些鏡像地址,國(guó)內(nèi)的話下載會(huì)穩(wěn)定點(diǎn),如果不是國(guó)內(nèi)的,請(qǐng)改成: 方法二 查看你的pom.xml文件里的spring-boot-maven-plugin部分是否有版本號(hào),如果沒(méi)有請(qǐng)加上: 方法

    2024年01月21日
    瀏覽(98)
  • For artifact {org.springframework.cloud:spring-cloud-starter-config:null:jar}: The version cannot be

    For artifact {org.springframework.cloud:spring-cloud-starter-config:null:jar}: The version cannot be

    For artifact {org.springframework.cloud:spring-cloud-starter-config:null:jar}: The version cannot be empty. 前情:之前down的項(xiàng)目一個(gè)多月沒(méi)有動(dòng)過(guò),前兩天想打開(kāi)看看突然所有的注解、n多類(lèi)報(bào)紅。回想了一下,唯一的操作是改了idea中關(guān)于maven的設(shè)置。 ????????????????--把maven倉(cāng)庫(kù)的地址改了

    2024年02月05日
    瀏覽(25)
  • 導(dǎo)入SpringCloud-Eureka依賴(lài)的問(wèn)題Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eure

    導(dǎo)入SpringCloud-Eureka依賴(lài)的問(wèn)題Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eure

    今天使用SpringCloud時(shí)遇到導(dǎo)入SpringCloud-Eureka依賴(lài)的問(wèn)題 Cannot resolve org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:unknown 網(wǎng)上搜了一下,回答多的五花八門(mén),但是不夠簡(jiǎn)單粗暴,這里介紹一個(gè)簡(jiǎn)單的方法,只需要在項(xiàng)目的pom文件中做些設(shè)置即可 把大象放進(jìn)冰箱里需要幾步

    2024年02月14日
    瀏覽(96)
  • Exception in thread “main“ org.apache.spark.sql.AnalysisException: Cannot write incompatible data to

    Exception in thread “main“ org.apache.spark.sql.AnalysisException: Cannot write incompatible data to

    這個(gè)問(wèn)題發(fā)生在 Spark SQL 將數(shù)據(jù)遷移進(jìn) Hive 時(shí)會(huì)出現(xiàn)。 這是因?yàn)閺?Spark 3.0.0 開(kāi)始,Spark SQL 增加了一個(gè)安全策略,不對(duì)非同類(lèi)型的數(shù)據(jù)進(jìn)行強(qiáng)制轉(zhuǎn)換,然后就會(huì)出現(xiàn)這個(gè)錯(cuò)誤。 我們?cè)谠创a文件 SQLConf.scala 中發(fā)現(xiàn)有這樣一個(gè)配置 StoreAssignmentPolicy : 其中有三種策略: ANSI 策略(

    2024年02月13日
    瀏覽(25)
  • 燒錄esp32遇到No serial data received

    燒錄esp32遇到No serial data received

    玩一個(gè)沒(méi)人用的esp32,燒錄時(shí)遇到錯(cuò)誤No serial data received, ? 在網(wǎng)上搜啥要我EN腳接高電平,才可以燒錄,然后我去看原理圖EN在9號(hào)引腳,尷尬的是我找不到芯片9號(hào)角,找了半天。。。,然后我朋友又給我一塊一樣芯片的esp32,只是這個(gè)沒(méi)串口通信,需要外置串口,我剛好有外

    2024年01月19日
    瀏覽(18)
  • 已解決org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factor

    已解決org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factory.異常的正確解決方法,親測(cè)有效?。。?org.springframework.beans.factory.UnsatisfiedDependencyException org.springframework.beans.factor 對(duì)于 org.springframework.beans.factory.UnsatisfiedDependencyException 異常,通常是由于依賴(lài)注

    2024年02月05日
    瀏覽(20)
  • org.springframework.context.ApplicationContextException: Failed to start bean ‘org.springframework.a

    使用RabbitMq測(cè)試交換機(jī)、隊(duì)列時(shí)候報(bào)的錯(cuò) 一開(kāi)始我以為是隊(duì)列的監(jiān)聽(tīng)器配置信息和監(jiān)聽(tīng)器代碼寫(xiě)錯(cuò)了,反復(fù)查看并沒(méi)有錯(cuò)誤。 然后繼續(xù)往下看報(bào)錯(cuò),有這倆報(bào)錯(cuò),瞬間頓悟。 ACCESS_REFUSED 這么大個(gè)字,看了好幾遍居然沒(méi)想到這方面的錯(cuò)誤,大概是配置密碼的時(shí)候copy錯(cuò)了 hotel

    2024年02月15日
    瀏覽(44)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包