产品版本 = NetBeans IDE 8.1 GlassFish 服务器开源版 4.1 我有一个使用 Netbeans 7.0.1 创建的非常简单的 Web 应用程序,其中仅包含 RESTful Web 服务。 这是我的 jsp 文件
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>TEST !</h1>
</body>
</html>
当我将项目部署到本地安装的 Glassfish 并运行 get http://http://localhost:8080/MyRest 中名为 (MyRest) 的项目时在我的浏览器中,一切都按预期执行,这意味着我可以看到我的“测试!”消息。
现在更改为 NetBeans,我在项目中打开节点“RESTful Web Services”,右键单击任何 HTTP 方法,然后从上下文菜单中选择“测试资源 Uri”。之后会出现一个警告对话框,其中包含以下消息:
Unable to open resource url:
http://localhost:8080/MyRest/webresources/service/getJsonWithParam
Make sure the project has been deployed successfully, and the server is
running.
我什至尝试手动更改网址,然后我得到
HTTP Status 404 - Not Found
type Status report
messageNot Found
descriptionThe requested resource is not available.
GlassFish Server Open Source Edition 4.1
请问有什么帮助吗?
最佳答案
您似乎已输入 http://两次!你也检查过这个吗?
关于java - GlassFish 服务器 HTTP 状态 404 - 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34357732/