java.io.IOException: Server returned HTTP response code: 403 for URL

问题描述

最近每次启动项目都会抛如下异常:

2018-03-29 09:01:07,831 DEBUG [ehcache] net.sf.ehcache.util.UpdateChecker.checkForUpdate(UpdateChecker.java:107) - Update check failed: 
java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.terracotta.org/kit/reflector?pageID=update.properties&patch=UNKNOWN&tc-product=ehcache-core+2.9.0&tc-version=2.9.0&uptime-secs=1&kitID=ehcache.default&jvm-version=1.8.0_151&os-name=Mac+OS+X&id=-1062731415&source=ehcache-core&jvm-name=Java+HotSpot%28TM%29+64-Bit+Server+VM&platform=x86_64
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) ~[?:1.8.0_151]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:1.8.0_151]
    at net.sf.ehcache.util.UpdateChecker.getUpdateProperties(UpdateChecker.java:153) ~[ehcache-2.9.0.jar:2.9.0]
    at net.sf.ehcache.util.UpdateChecker.doCheck(UpdateChecker.java:117) ~[ehcache-2.9.0.jar:2.9.0]
    at net.sf.ehcache.util.UpdateChecker.checkForUpdate(UpdateChecker.java:104) [ehcache-2.9.0.jar:2.9.0]
    at net.sf.ehcache.util.UpdateChecker.run(UpdateChecker.java:95) [ehcache-2.9.0.jar:2.9.0]
    at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_151]
    at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_151]

经研究发现,原来是ehcache捣的鬼,每次启动都会访问官方网站查看是否有最新版本,这样也可以统计有多少用户和服务器在使用ehcache。很可能是一个后门程序,默认开启。

解决方案

找到ehcache.xml文件,ehcache标签中添加属性updateCheck=”false”,如下:

<ehcache name="ehcache" updateCheck="false">

或如下方式修改:

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">

再次重启,问题即可解决。


原文: https://blog.csdn.net/wo541075754/article/details/79737289

  • 6
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值