404错误 – 在Google Cloud平台虚拟机中运行部署的Java后端时发生

huangapple 未分类评论44阅读模式
英文:

404 error - when running deployed Java back in Google cloud platform vm

问题

我有一个Java Spring Framework后端,其中还包含REST API。
我已经成功将应用部署在Google Cloud平台的vm实例中,在将Eclipse与Google Cloud平台连接后。我的问题是,当我尝试运行以下网址时:
https://industrial-net-242708.appspot.com/...
我收到404错误:未找到。当我运行以下网址时:https://35.228.187.51:80,我收到:

"此网站无法访问
35.228.187.51拒绝连接。"

我还在防火墙规则中为vm实例创建了端口。但我无法理解出了什么问题。

我在ssh终端中执行了命令 netstat -l,发现了这个:

活动的互联网连接(仅服务器) 协议 接收队列 发送队列 本地地址 外部地址 状态
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 0.0.0.0:boo
tpc 0.0.0.0:*
udp 0 0 instance-education-:ntp 0.0.0.0:*
udp 0 0 localhost:ntp 0.0.0.0:*
udp 0 0 0.0.0.0:ntp 0.0.0.0:*
udp6 0 0 fe80::4001:aff:fea6:ntp [::]:*
udp6 0 0 localhost:ntp [::]:*
udp6 0 0 [::]:ntp [::]:

这意味着vm实例不监听内部或外部IP地址。我该如何修复它?

我想知道在Google Cloud服务器Debian 9 / Linux上成功运行我的Java应用程序的确切步骤。我的计算机使用Windows 10作为操作系统。

英文:

I have a Java spring framework back end which also contains rest API.
I deployed successfully the app in vm instance Google cloud platform, after connecting Eclipse with Google cloud platform. My problem is that when I try to run:
https://industrial-net-242708.appspot.com/..., I get a 404 error: not found. When I run this one: https://35.228.187.51:80, I get:
>```
'''This site can't be reached
35.228.187.51 refused to connect.'''

I have also created ports in firewall rules fot the vm instance. But I cannot understand what is wrong.

I executed the command netstat -l in ssh terminal and I found out this:

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State 
tcp  0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 
tcp6 0 0 [::]:ssh [::]:* LISTEN 
udp  0 0 0.0.0.0:boo 
tpc  0.0.0.0:* 
udp  0 0 instance-education-:ntp 0.0.0.0:* 
udp  0 0 localhost:ntp 0.0.0.0:* 
udp  0 0 0.0.0.0:ntp 0.0.0.0:* 
udp6 0 0 fe80::4001:aff:fea6:ntp [::]:* 
udp6 0 0 localhost:ntp [::]:* 
udp6 0 0 [::]:ntp [::]: 

This means that the vm instance does not listen to the internal or external IP address How can I fix it?

I want to know the exact steps I have to follow in order to make my Java application run successfully in a Google cloud server debian 9 / Linux. My computer has Windows 10 as an OS.

huangapple
  • 本文由 发表于 2020年4月4日 08:33:35
  • 转载请务必保留本文链接:https://java.coder-hub.com/61022362.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定