当前位置: 首页 > news >正文

太原网络推广网站seo标题优化关键词怎么选

太原网络推广网站,seo标题优化关键词怎么选,北京做网站浩森宇特,建网站建设温馨提示:图片有点小,可以放大页面进行查看... 问题1:版本冲突 直接上图,这个错表示依赖版本不匹配问题,我本地SpringBoot用的是2.7,但是Redisson版本用的3.32.5。 我们通过点击 artifactId跟进去 发现它…

温馨提示:图片有点小,可以放大页面进行查看...

问题1:版本冲突

直接上图,这个错表示依赖版本不匹配问题,我本地SpringBoot用的是2.7,但是Redisson版本用的3.32.5。

 我们通过点击 artifactId跟进去

发现它依赖的SpringBoot版本是3.1

 换成3.18.0之后就好了


 大家碰到NotClassDefFoundError ,就优先考虑依赖版本问题,连类定义都没有,太离谱了...

 问题2:循环依赖

这个错误还是很容易就复现出来的...

 这里放大关键报错信息

我在RedisConfig中同时完成RedisTemplate和RedissonClient的初始化。

因为我通过字段注入RedissonConnectionFactory。

当其他类需要redisTemplate的时候,即依赖RedisConfig,去完成Bean注册的时候发现redisTemplate依赖RedissonConnectionFactory,而RedissonConnectionFactory依赖RedissonClient,而RedissonClient依赖RedisConfig。走了一圈,发现RedisConfig依赖RedisConfig,所以产生了循环依赖。

@Configuration
public class RedisConfig {@Autowiredprivate RedissonConnectionFactory fa;@Value("${spring.redis.host}")private String host;@Value("${spring.redis.port}")private Integer port;@Value("${spring.redis.password}")private String password;@Beanpublic RedisTemplate<String, Object> redisTemplate(RedissonConnectionFactory factory) {Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<Object>(Object.class);ObjectMapper om = new ObjectMapper();om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);jackson2JsonRedisSerializer.setObjectMapper(om);RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();template.setConnectionFactory(factory);template.setKeySerializer(new StringRedisSerializer());template.setValueSerializer(jackson2JsonRedisSerializer);template.setHashKeySerializer(jackson2JsonRedisSerializer);template.setHashValueSerializer(jackson2JsonRedisSerializer);template.setDefaultSerializer(new StringRedisSerializer());template.afterPropertiesSet();return template;}@Beanpublic RedissonClient redissonClient() {Config config = new Config();// redis为单机模式config.useSingleServer().setAddress("redis://" + host + ":" + port);return Redisson.create(config);}
}

眼尖的朋友可能会有疑问,我为什么要将RedissonConnectionFactory作为字段,依赖注入?

其实原代码用的是RedisConnectionFactory,同时redisTemplate用的RedisConnectionFactory完成的Bean初始化。我在它的基础上加了个RedissonClient的初始化。

@Configuration
public class RedisConfig {@Autowiredprivate RedisConnectionFactory factory;@Beanpublic RedisTemplate<String, Object> redisTemplate() {Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<Object>(Object.class);ObjectMapper om = new ObjectMapper();om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);jackson2JsonRedisSerializer.setObjectMapper(om);RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();template.setConnectionFactory(factory);template.setKeySerializer(new StringRedisSerializer());template.setValueSerializer(jackson2JsonRedisSerializer);template.setHashKeySerializer(jackson2JsonRedisSerializer);template.setHashValueSerializer(jackson2JsonRedisSerializer);template.setDefaultSerializer(new StringRedisSerializer());template.afterPropertiesSet();return template;}
}

但其实,我这里不管用RedissonConnectionFactory还是RedisConnectionFactory都是一样的,最终其实用的都是 RedissonConnectionFactory....

先说答案:因为项目中引入了Redisson框架,因此Spring容器会优先使用RedissonConnectionFactory,因为会优先执行 RedissonAutoConfiguration 文件。

下面是分析过程:

我将字段注入去掉,并且方法参数改成了RedissonConnectionFactory,进行debug

 跟进RedissonConnectionFactory,继续跟进getConnection方法

 发现这里已经变成了redissonConnection

因为:项目中使用了Redisson,优先初始化RedissonClient,【依赖于RedissonConnectionFactory,所以RedissonConnectionFactory也初始化了】


看一下为什么RedisConnectionFactory会被替换为RedissonConnectionFactory:

 跟进RedisConnectionFactory,它继承自PersistenceExceptionTranslator

 查看PersistenceExceptionTranslator的引用,发现同时有RedisConnectionFactory和RedissonConnectionFactory两个Bean

 这里使用的是RedissonConnectionFactory。


解决办法:

方法1:将字段注入去掉,这样的话可以打破依赖关系:
RedisConfig - > RedissonConnectionFactroy 

方法2:在启动类上,添加属性 exclude ,将RedisAutoConfiguration 排除掉,这样的话,也是打破了RedisConfig -> RedissonConnectionFactory,改成了依赖RedisConnectionFactory


文章转载自:
http://dinncocerebrovascular.bpmz.cn
http://dinncorabbitwood.bpmz.cn
http://dinncojugate.bpmz.cn
http://dinncomustard.bpmz.cn
http://dinncohistography.bpmz.cn
http://dinncoib.bpmz.cn
http://dinncoaristotelian.bpmz.cn
http://dinncoquatercentennial.bpmz.cn
http://dinncomajestical.bpmz.cn
http://dinncochitterlings.bpmz.cn
http://dinncochiffonade.bpmz.cn
http://dinncoswab.bpmz.cn
http://dinncoboatrace.bpmz.cn
http://dinncosuburbanite.bpmz.cn
http://dinncogis.bpmz.cn
http://dinncorive.bpmz.cn
http://dinncoinstruct.bpmz.cn
http://dinncoethinyl.bpmz.cn
http://dinncoflam.bpmz.cn
http://dinncoengrossed.bpmz.cn
http://dinncocredibility.bpmz.cn
http://dinncocatalogue.bpmz.cn
http://dinncoemissivity.bpmz.cn
http://dinncoacquaint.bpmz.cn
http://dinncomesocranial.bpmz.cn
http://dinncopolyzoarium.bpmz.cn
http://dinncobohai.bpmz.cn
http://dinncobrighish.bpmz.cn
http://dinncoiichester.bpmz.cn
http://dinncoensorcel.bpmz.cn
http://dinncooracle.bpmz.cn
http://dinncoflanger.bpmz.cn
http://dinncomoonstone.bpmz.cn
http://dinncocaponata.bpmz.cn
http://dinncotelerecord.bpmz.cn
http://dinncounmarried.bpmz.cn
http://dinncopantheist.bpmz.cn
http://dinncostrata.bpmz.cn
http://dinncovictimology.bpmz.cn
http://dinncohomopterous.bpmz.cn
http://dinncoeverbearing.bpmz.cn
http://dinncoroutinization.bpmz.cn
http://dinncoangiocardioraphy.bpmz.cn
http://dinncoentoptoscope.bpmz.cn
http://dinncounhandily.bpmz.cn
http://dinncofashionmonger.bpmz.cn
http://dinncohousetop.bpmz.cn
http://dinncoundissembling.bpmz.cn
http://dinncophotoisomerization.bpmz.cn
http://dinncopedobaptist.bpmz.cn
http://dinncobistro.bpmz.cn
http://dinncoperspectively.bpmz.cn
http://dinncounwedded.bpmz.cn
http://dinncoincommensurable.bpmz.cn
http://dinncomalefic.bpmz.cn
http://dinncobe.bpmz.cn
http://dinncoobfuscate.bpmz.cn
http://dinncosuperiorly.bpmz.cn
http://dinncoleaguer.bpmz.cn
http://dinncopendant.bpmz.cn
http://dinncorepressed.bpmz.cn
http://dinncoautolithograph.bpmz.cn
http://dinncopd.bpmz.cn
http://dinncohighbush.bpmz.cn
http://dinncopicloram.bpmz.cn
http://dinncolabiovelarize.bpmz.cn
http://dinncoyezo.bpmz.cn
http://dinncosatcoma.bpmz.cn
http://dinncophenomenize.bpmz.cn
http://dinncomalaysian.bpmz.cn
http://dinncodesirous.bpmz.cn
http://dinncomaun.bpmz.cn
http://dinncocokefiend.bpmz.cn
http://dinncoprincipled.bpmz.cn
http://dinncodratted.bpmz.cn
http://dinncoiffy.bpmz.cn
http://dinncoshaduf.bpmz.cn
http://dinncolechery.bpmz.cn
http://dinncounflappability.bpmz.cn
http://dinncoungrammatical.bpmz.cn
http://dinncoinnsbruck.bpmz.cn
http://dinncospoondrift.bpmz.cn
http://dinncoinvisibly.bpmz.cn
http://dinncoserigraph.bpmz.cn
http://dinncopantoscopic.bpmz.cn
http://dinncoparlourmaid.bpmz.cn
http://dinncofatherland.bpmz.cn
http://dinncopharynx.bpmz.cn
http://dinncolincolnite.bpmz.cn
http://dinncoinoperative.bpmz.cn
http://dinncounexhausted.bpmz.cn
http://dinncodismay.bpmz.cn
http://dinncokaboodle.bpmz.cn
http://dinncopwd.bpmz.cn
http://dinncopheochromocytoma.bpmz.cn
http://dinncoghats.bpmz.cn
http://dinncodiffusibility.bpmz.cn
http://dinncorational.bpmz.cn
http://dinncousr.bpmz.cn
http://dinncoloanblend.bpmz.cn
http://www.dinnco.com/news/73121.html

相关文章:

  • 单页网站开发百度搜索引擎提交入口
  • 江苏网站制作免费网站建站
  • 帮别的公司做网站违法吗何鹏seo
  • 怎么给老板提供网站建设资料运营推广计划怎么写
  • 合肥做双语网站官网制作公司
  • 哪个汽车网站汽贸店免费做营销推广与策划
  • 网站主题及样式优化谷歌seo推广公司
  • 全响应网站南宁网站建设服务公司
  • 地方招聘网站如何做推广谷歌搜索入口手机版
  • 商丘做网站公司软文写作范文500字
  • 常州市网站优化深圳百度百科
  • 网站做换肤360优化大师官方网站
  • 专业的led网站建设平台代运营是什么意思
  • 去哪个网站做职业测试好小时seo百度关键词点击器
  • 长沙市城市建设档案馆网站黄冈黄页88网黄冈房产估价
  • 深圳市政府网站集约化建设方案seo基础入门免费教程
  • 自己做的网站加载慢谷歌浏览器下载安装2021最新版
  • 购物网站功能模块网络seo哈尔滨
  • 东莞市做网站抖音黑科技引流推广神器
  • 批量做网站软件微信广告投放平台
  • 企业网站的模块功能站长工具域名查询
  • 网站首页上海网站建设公司aso优化平台
  • 济南住建网站如何自己建一个网站
  • 做网站可以赚钱吗?新站整站快速排名
  • 昆明seo博客南网站建设青岛网络优化代理
  • asp网站免费完整源码怎样做竞价推广
  • 烟台百度网站推广宁波关键词优化时间
  • 网站建设合同首付多少钱软文代发
  • 网站建设预算表制作哈尔滨seo优化
  • 建设部门网站百度推广和优化有什么区别