java GlassFish Server HTTP 状态 404 - 未找到

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34357732/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 22:48:32  来源:igfitidea点击:

GlassFish Server HTTP Status 404 - Not Found

javanetbeansweb-applicationsglassfishserver

提问by Ahmed202

Product Version = NetBeans IDE 8.1 GlassFish Server Open Source Edition 4.1 I have a very simple web application created with Netbeans 7.0.1 which includes only a RESTful Webservice. Here my jsp file

产品版本 = 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>

When I deploy the project to my locally installed Glassfish and run the projet named (MyRest) in get http://http://localhost:8080/MyRestin my browser everything is executed as expected what means that I can see my "TEST !" message.

当我将项目部署到本地安装的 Glassfish 并在浏览器中的 get http://http://localhost:8080/MyRest中运行名为 (MyRest) 的项目时,一切都按预期执行,这意味着我可以看到我的“TEST” !” 信息。

Now changing to NetBeans I open in my project the node "RESTful Web Services", make a right-click on any HTTP method and choose "Test Resource Uri" from the context menu. After that a warning dialog shows up with the following message:

现在更改为 NetBeans,我在我的项目中打开节点“RESTful Web 服务”,右键单击任何 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.

I even tried to change the url manually then I get

我什至尝试手动更改网址,然后我得到

HTTP Status 404 - Not Found
type Status report

messageNot Found

descriptionThe requested resource is not available.


GlassFish Server Open Source Edition 4.1

Any help please ?

请问有什么帮助吗?

回答by shaneeqa

Seems you have typed http:// two times! Did you check this as well?

好像你输入了两次 http://!你也检查过这个吗?