Eclipse JBOSS Rest服务404 helloworld

Eclipse JBOSS Rest服务404 helloworld,eclipse,rest,jakarta-ee,jboss,Eclipse,Rest,Jakarta Ee,Jboss,我正试图用jboss在eclipse中运行一个基本的restful服务。我在JBoss7服务器上运行该程序,然后通过chrome扩展邮递员发送get请求。使用url: http://localhost:8080/SIMSWEB/MyRESTApplication 除了我总是收到404错误响应外,我的web.xml文件和服务文件似乎都很正常,所以我不确定问题出在哪里,如果您能提供帮助,我们将不胜感激 这是我的HelloWorldSerice文件: package com.sims.webserv

我正试图用jboss在eclipse中运行一个基本的restful服务。我在JBoss7服务器上运行该程序,然后通过chrome扩展邮递员发送get请求。使用url:

http://localhost:8080/SIMSWEB/MyRESTApplication
除了我总是收到404错误响应外,我的web.xml文件和服务文件似乎都很正常,所以我不确定问题出在哪里,如果您能提供帮助,我们将不胜感激

这是我的HelloWorldSerice文件:

package com.sims.webservices;

import javax.inject.Inject;
import javax.ws.rs.Produces;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

import com.sims.model.business.Parentbean;

@Path("/MyRESTApplication")
public class HelloWorldResource {


@Inject
private Parentbean subjectbean;


@GET()
@Produces("text/plain")
public String sayHello() {

    return "Hello World!";
}
}
这是我的web.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>SIMSWEB</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.jboss.samples.rs.webservices.MyRESTApplication</param-value>
</context-param>
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>

模拟人生网
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
放松
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
放松
/*
javax.ws.rs.Application
org.jboss.samples.rs.webservices.MyRESTApplication
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
/面孔/*

不确定,到底是什么问题,但我让它为您工作。我已经共享了war文件

您可能需要检查您的库和org.jboss.samples.rs.webservices.MyRESTApplication java文件

顺便说一下,部署后我可以访问

http://localhost:8080/SIMSWEB/MyRESTApplication 
看看“你好,世界!”