1.报错

com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class org.springframework.session.data.mongo.MongoSession]: missing type id property '@class'

 at [Source: (String)"{"_id": "43386047-6d40-40fa-84e9-01b01ee00df5", "created": {"$date": "2021-05-15T13:44:27.095Z"}, "accessed": {"$date": "2021-05-15T13:44:27.096Z"}, "interval": "PT30M", "principal": null, "expireAt": {"$date": "2021-05-15T14:14:27.096Z"}, "attr": {"$binary": {"base64": "rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAB3CAAAABAAAAAAeA==", "subType": "00"}}}"; line: 1, column: 405]

image.png

image.png

session_mongodb.rar



2.运行老师的源码也报错:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-05-15 22:01:11.579 ERROR 15992 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat


相关课程:JAVA 全系列>第十五阶段:Spring Session会话管理>Spring Session MongoDB>更换Spring Session MongoDB序列化器

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637