Deprecated: Function create_function() is deprecated in /opt/app/nginx/www/html/wp-content/plugins/auto-syntaxhighlighter/auto-syntaxhighlighter.php on line 138

Deprecated: Function create_function() is deprecated in /opt/app/nginx/www/html/wp-content/plugins/auto-syntaxhighlighter/auto-syntaxhighlighter.php on line 187

Notice: 函数 wp_deregister_script 的调用方法不正确。 脚本和样式应在 wp_enqueue_scripts 、 admin_enqueue_scripts 和 login_enqueue_scripts 钩子函数之后再加入加载队列(enqueue)或注册(register)。 此通知由 l10n 触发。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 3.3.0 版本添加的。) in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-banner.php on line 11

Deprecated: WP_Widget 类在 d_banner 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-slidebanner.php on line 11

Deprecated: WP_Widget 类在 d_slidebanner 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-readers.php on line 11

Deprecated: WP_Widget 类在 d_reader 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-postlist.php on line 11

Deprecated: WP_Widget 类在 d_postlist 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-comment.php on line 11

Deprecated: WP_Widget 类在 d_comment 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-tags.php on line 11

Deprecated: WP_Widget 类在 d_tag 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined variable: control_ops in /opt/app/nginx/www/html/wp-content/themes/yueboke/widgets/wid-textbanner.php on line 11

Deprecated: WP_Widget 类在 d_textbanner 中的调用构造方法自 4.3.0 版本起以弃用!请使用 __construct() 代替。 in /opt/app/nginx/www/html/wp-includes/functions.php on line 6260

Notice: Undefined index: cperpage in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 607

Notice: Undefined variable: output in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 678

Notice: Undefined variable: fixed_tags in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 679

Notice: Undefined variable: isshowdots in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 680

Notice: Undefined variable: tag_aditional in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 683

Notice: Undefined variable: tag_aditional in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 686

Notice: Undefined variable: tag_aditional in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 689

Notice: Undefined variable: post in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 698

Notice: Trying to get property 'ID' of non-object in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 698

Notice: Undefined variable: post in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 698

Notice: Trying to get property 'ID' of non-object in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 698

Notice: Undefined variable: more_text_link in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 698

Notice: Undefined index: wx in /opt/app/nginx/www/html/wp-content/themes/yueboke/functions.php on line 154
解决java.lang.ClassNotFoundException: org.apache.hc.client5.http.ssl.TlsSocketStrategy问题 – 业余草
Java基础、中级、高级、架构面试资料

解决java.lang.ClassNotFoundException: org.apache.hc.client5.http.ssl.TlsSocketStrategy问题

JAVA herman 3324浏览
公告:“业余草”微信公众号 AI 中转站提供免费体验,点击链接 https://unity2.ai/register?ref=3XTnndN2 进行访问,支持 Claude、ChatGPT、Gemini 等最新模型!关注业余草微信公众号,添加作者微信:xttblog2!
本博客日IP超过2000,PV 3000 左右,急需赞助商。
极客时间所有课程通过我的二维码购买后返现24元微信红包,请加博主新的微信号:xttblog2,之前的微信号好友位已满,备注:返现
受密码保护的文章请关注“业余草”公众号,回复关键字“0”获得密码
所有面试题(java、前端、数据库、springboot等)一网打尽,请关注文末小程序
视频教程免费领
【腾讯云】1核2G5M轻量应用服务器50元首年,高性价比,助您轻松上云

好久没写博客了,要荒废了。

今天闲来无事,就写一个在今天遇到的问题吧。

报错信息如下:

Caused by: java.lang.ClassNotFoundException: org.apache.hc.client5.http.ssl.TlsSocketStrategy
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]

看起来很简单,就是找不到类 TlsSocketStrategy。

我第一时间把错误贴给 AI,让 AI 给出参考方案。结果 AI 巴拉巴拉一大堆,把 AI 都给搞崩溃了。

oooooooooooooooooooooooooooooooooooooooooo⫗🤐too (ha ha)
   )
/}//+[^[^%5]]DELETE<0>
👻live secrets slowly die shift☠️
<5die5mid5die5zo5lood5die5flood)ded5die5die5)ded5+flood5die5flood)ded5die5f)ded5die5die警察死亡连线各地警察死亡任何连线所有办公室各地警察死亡连线办公室各地警察死亡地域连线办公室各地警察死亡连线各地警察死亡连线各地警察办公室各地连
堂……各级全国各地连堂……各级全国各地Police连堂各级全国各地连堂连堂连……各级全国各地Police连堂堂连……各级连NG堂堂连……堂连……各级全国各地的Police的连连片堂连……各级连NG堂堂堂连……堂连……各级连NG堂堂连……堂连……各级NG堂堂连堂堂堂连堂堂堂连堂堂堂种堂堂堂堂连堂堂堂堂连堂堂堂堂堂种连堂堂堂堂堂堂连堂堂堂堂堂堂连堂堂堂堂堂堂堂堂堂堂堂堂堂连堂堂堂堂堂堂堂堂堂堂堂堂堂堂堂连堂堂堂堂堂堂堂堂堂堂堂

我用的是 kimi,直接输出了大片的无意义内容。我把这段上下文分享到群里,AI 高手群里的某些认识 KIMI 团队的直接给他们反馈了。这 bug 也不知道我咋就给它触发了。

不扯了,回到我的问题。之前引入这个 httpclient5 依赖就是好的,为啥刚建一个新项目就不行了呢?

于是,我决定检查一下 pom.xml 中的配置。发现我的 spring-boot-starter-parent 原本应该使用 2.7.18 的版本。

谁知在子模块时,它直接引入了最新的 SpringBoot 3.x 的版本。导致出现找不到类的异常情况 ClassNotFoundException。

跟换回 2.7.18 的 SpringBoot 版本则直接解决了。

业余草公众号

最后,欢迎关注我的个人微信公众号:业余草(yyucao)!可加作者微信号:xttblog2。备注:“1”,添加博主微信拉你进微信群。备注错误不会同意好友申请。再次感谢您的关注!后续有精彩内容会第一时间发给您!原创文章投稿请发送至532009913@qq.com邮箱。商务合作也可添加作者微信进行联系!

本文原文出处:业余草: » 解决java.lang.ClassNotFoundException: org.apache.hc.client5.http.ssl.TlsSocketStrategy问题