当前位置:网站首页>curl (7) Failed connect to localhost8080; Connection refused
curl (7) Failed connect to localhost8080; Connection refused
2022-07-30 05:26:00 【m0_67391518】
curl: (7) Failed connect to localhost:8080; Connection refused
If you are also curl, Baidu is normal, curl (own IP) is normal, but a curl http://localhost:8080 will give you an error, then you can try the following methods!
I have searched for many methods before, saying that the problem of nignx, or the problem of the port, I have tried it for a long time to no avail.Followed by a blogger who said that you can look at the log, I opened the log and looked at it, and found the problem 
There is a logs file in the tomcat folder

Find the filename of the image above and open it with a text editor
Here tells me that /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java is actually installed, but there is noThe so-called /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java directory, but /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/
So let's check the jdk path now

Then use vi /etc/profile to modify the path configuration of jdk
Set the previous JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java
Change to the current JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre

Update the next file
source /etc/profile
Restart tomcat, and then curl can access successfully
/
边栏推荐
- 容器化 | 在 KubeSphere 中部署 MySQL 集群
- 工具 | 常用 PostgreSQL 预防数据丢失方案
- curl (7) Failed connect to localhost8080; Connection refused
- go language study notes 4
- Small program npm package--API Promise
- 视野 | KeyDB:为 Web 应用而生的高性能 Redis 分支
- C语言实现安全性极高的游戏存档并读档
- mysql隔离级别
- mysql无法远程连接 Can‘t connect to MySQL server on ‘xxx.xxx.xxx.xxx‘ (10060 “Unknown error“)
- 涂鸦Wi-Fi&BLE SoC开发幻彩灯带
猜你喜欢
随机推荐
MySQL安装配置教程(超级详细)
开源之夏 2022 重磅来袭!欢迎报名 RadonDB 社区项目!
【Redis高手修炼之路】Jedis——Jedis的基本使用
1315_Use the LOOPBACK simulation mode to test whether the pyserial installation is successful
L2-020 descendants of kung fu
翻译 | Kubernetes 将改变数据库的管理方式
罗湖区工匠技能领军人才奖励项目申请指南
Kyligence 入选 Gartner 2022 数据管理技术成熟度曲线报告
LeetCode Algorithm 328. Parity linked list
光明区关于促进科技创新的若干措施(征求意见稿)
oracle触发器的自治事务
Docker-compose安装mysql
剑指offer(刷题篇12)
翻译 | 解读首部 Kubernetes 纪录片
go语言学习笔记二
[High Performance Computing] openMP
Plan for many situations in the processing chain
RadonDB MySQL on K8s 2.1.3 发布!
Seata异常:endpoint format should like ip:port
gnss rtcm rtklib Ntrip...









