收到错误消息“无法加载资源:服务器以状态404(未找到)进行响应". [英] getting error message "Failed to load resource: the server responded with a status of 404 (Not Found)"

查看:247
本文介绍了收到错误消息“无法加载资源:服务器以状态404(未找到)进行响应".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的MVC Web应用程序,该应用程序在三周前在本地运行,没有任何问题.

I have a simple MVC web application, which was running locally without problems 3 weeks ago.

当我现在在Netbeans中打开应用程序并运行它时,一切似乎也都可以正常工作.但是,当我转到浏览器(在我的情况下为google chrome)查看应用程序的前端时(位于 http://localhost :8080/optimizer ),我收到以下错误消息:

When I now open the application in Netbeans and run it, everything seems to work fine as well. However, when I go to the browser (in my case google chrome) to look at the app's frontend (at http://localhost:8080/optimizer), I get the following error message:

HTTP Status 404 - Not Found 

在Chrome的javascript控制台中,给出以下错误消息:

In Chrome's javascript console the following error message is given:

optimizer:1 Failed to load resource: the server responded with a status of 404 (Not Found)

优化程序"是应用程序的名称. ("optimizer:1"中"1"的意义是什么?...我也不明白这一点.)

"optimizer" is the name of the app. (What's the point of the "1" in "optimizer:1"? ... I don't get this either.)

服务器(payara)正在运行:

The server (payara) is running:

我还可以访问服务器的管理页面:

I can also reach the server's admin page:

但是,尽管3周前一切正常,但服务器似乎无法找到该应用程序……我只是不明白. 怎么了?我该如何解决?

However, somehow the server cannot seem to find the application, although 3 weeks ago everything worked fine ... I just don't get it. What's wrong? How can I fix this?

更新:

在Payara的管理控制台中单击列出已部署的应用程序"会显示我的应用程序尚未部署(!).

Clicking on "List Deployed Applications" in Payara's Admin Console reveals that my app is not(!) deployed.

我试图通过单击部署应用程序"->选择文件"来部署它. 我选择了jar文件"optimizer-1.0-SNAPSHOT.jar",选择了"EJB Jar"类型,然后单击确定".

I tried to deploy it by clicking on "Deploy an Application" -> "Choose file". I selected the jar-file "optimizer-1.0-SNAPSHOT.jar", selected Type "EJB Jar", then clicked on OK.

我收到此错误消息:

Archive type of /private/var/folders/hh/hgq7wrjn5d51gy2tkbxkkbwh0000gn/T/optimizer-15075570634779987058.0-SNAPSHOT.jar was not recognized

如何部署我的应用程序?为何它会自动运行,而现在却不再运行?

How can I deploy my app? And why did it work automatically before and now it doesn't work any more?

更新2:

与之前(3周前)相比,我意识到的区别是,运行应用程序时浏览器不再自动打开. 此外,谷歌浏览器曾经是IDE的默认浏览器...现在只有一个灰色的地球,我再也无法选择Chrome作为浏览器了:

A difference I realise compared to before (3 weeks ago) is that the browser doesn't open automatically any more when I run the app. Furthermore, Google Chrome used to be the IDE'S default browser ... now there is just a grey globe and I can no longer choose Chrome as my browser:

更新3:

我刚刚注意到启动服务器时出现一条错误消息(它位于日志输出的数百行中间,因此我一开始没有注意到它)

I just noticed there is an error message that appears when the server is started (it's in the middle of hundred of rows of log output so I didn't notice it at first):

更新4:

-> NetBeans IDE 11.2 -> Payara服务器5.193

-> NetBeans IDE 11.2 -> Payara Server 5.193

推荐答案

好,我现在发现了如何在本地运行应用程序而没有问题:通过创建.war文件而不是.jar文件-现在,我可以运行再次出现问题.

Ok, I now found out how to run the app locally without problems: by creating a .war file instead of a .jar file - now I can run the app again without problems.

这篇关于收到错误消息“无法加载资源:服务器以状态404(未找到)进行响应".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆