【问题标题】:GlassFish Server HTTP Status 404 - Not FoundGlassFish 服务器 HTTP 状态 404 - 未找到
【发布时间】:2016-03-25 06:54:01
【问题描述】:

产品版本 = NetBeans IDE 8.1 GlassFish Server 开源版 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) 的项目时,一切都按预期执行,这意味着我可以看到我的“TEST!”消息。

现在更改为 NetBeans 我在我的项目中打开节点“RESTful Web Services”,右键单击任何 HTTP 方法并从上下文菜单中选择“Test Resource 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

有什么帮助吗?

【问题讨论】:

  • 你是在 NB 7.0.1 中创建的,然后用 NB 8.1 打开它吗?它在 NB 7.0.1 中是否有效,还是总是这样失败?
  • 不,我是在 NB 8.1 中创建的
  • 当你测试它没有 netbeans你的glasfish服务器运行。现在,在您启动 Netbeans 之前,您是否已关闭 Glasfish? If Not Netbeans 使用下一个端口,即 8081 !你测试过这个吗?

标签: java netbeans web-applications glassfish server


【解决方案1】:

您似乎输入了两次 http://!你也检查过这个吗?

【讨论】:

  • 他没有输入,这就是他遇到问题的原因
猜你喜欢
  • 2020-07-31
  • 2015-12-09
  • 2020-03-20
  • 1970-01-01
  • 2023-03-03
  • 2015-12-29
  • 2017-11-11
  • 2018-06-30
相关资源
最近更新 更多