Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/rest/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java RESTWeb服务404错误-JBoss Eclipse_Java_Rest_Server_Jboss_Http Status Code 404 - Fatal编程技术网

Java RESTWeb服务404错误-JBoss Eclipse

Java RESTWeb服务404错误-JBoss Eclipse,java,rest,server,jboss,http-status-code-404,Java,Rest,Server,Jboss,Http Status Code 404,大家好,我有一个问题,我不能在JBOSS 7.0.1服务器上部署restful服务,它看起来是已部署的,但问题是,当我在服务中通过post尝试它时,我得到404错误。。。。我不知道在这种情况下该怎么办,对于同一服务器上的其他web项目,我没有问题 它是从SVN存储库导入的项目 我发帖子的链接是 我有三个项目: 工程耳 EJB项目 战争计划 服务器日志 14:45:42,850 INFORMACIÓN [org.jboss.modules] JBoss Modules version 1.1

大家好,我有一个问题,我不能在JBOSS 7.0.1服务器上部署restful服务,它看起来是已部署的,但问题是,当我在服务中通过post尝试它时,我得到404错误。。。。我不知道在这种情况下该怎么办,对于同一服务器上的其他web项目,我没有问题

它是从SVN存储库导入的项目

我发帖子的链接是

我有三个项目:

  • 工程耳
  • EJB项目
  • 战争计划
服务器日志

14:45:42,850 INFORMACIÓN [org.jboss.modules] JBoss Modules version 1.1.5.GA
14:45:43,131 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
14:45:43,293 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
14:45:44,258 INFO  [org.xnio] XNIO Version 3.0.3.GA
14:45:44,258 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
14:45:44,267 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
14:45:44,282 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
14:45:44,298 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
14:45:44,313 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
14:45:44,345 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
14:45:44,376 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
14:45:44,376 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.6.final
14:45:44,392 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
14:45:44,413 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
14:45:44,425 INFO  [org.jboss.as.connector] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
14:45:44,431 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
14:45:44,439 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
14:45:44,558 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
14:45:44,766 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.1.GA
14:45:44,839 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)
14:45:44,864 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
14:45:45,232 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Arrancando Coyote HTTP/1.1 en puerto http--0.0.0.0-8080
14:45:45,232 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Arrancando Coyote HTTP/1.1 en puerto http--0.0.0.0-8443
14:45:45,393 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on /0.0.0.0:4447
14:45:45,395 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on localhost/127.0.0.1:9999
14:45:45,397 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.0.Final\standalone\deployments
14:45:45,401 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment Project-EAR.ear
14:45:45,423 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found Project-EAR.ear in deployment directory. To trigger deployment create a file called Project-EAR.ear.dodeploy
14:45:45,626 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "Project-EAR.ear"
14:46:03,066 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jaxb-api.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-impl-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,068 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry activation.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-impl-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,071 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jsr173_1.0_api.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-impl-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,074 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jaxb1-impl.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-impl-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,077 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jaxb-api.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-xjc-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,079 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jaxb-impl.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-xjc-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,082 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry jsr173_1.0_api.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-xjc-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,085 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry activation.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/jaxb-xjc-2.2.5.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,089 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) Class Path entry activation.jar in "/C:/jboss-as-7.1.0.Final/standalone/deployments/Project-EAR.ear/mail-1.4.jar"  does not point to a valid jar for a Class-Path reference.
14:46:03,097 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "Project-WAR.war"
14:46:03,381 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment Project-EAR.ear
14:46:03,434 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016002: Processing weld deployment Project-WAR.war
14:46:03,450 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: Project-EAR.ear
14:46:03,483 INFO  [org.jboss.weld.Version] (MSC service thread 1-4) WELD-000900 1.1.5 (AS71)
14:46:03,516 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment Project-EAR.ear
14:46:03,990 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /Project-WAR
14:46:03,992 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 21819ms - Started 238 of 327 services (76 services are passive or on-demand)
14:46:04,035 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "Project-EAR.ear"
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name>Restful Web Application</display-name>

</web-app>

Restful Web应用程序
applicationconfig.java

package com.services.rest;

import java.util.Set;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("")
public class ApplicationConfig extends Application {

    @Override
    public Set<Class<?>> getClasses() {

        Set<Class<?>> resources = new java.util.HashSet<Class<?>>();
        addRestResourceClasses(resources);
        return resources;
    }

    private void addRestResourceClasses(Set<Class<?>> resources) {
        resources.add(ServiceExample.class);

    }

}
package com.services.rest;
导入java.util.Set;
导入javax.ws.rs.ApplicationPath;
导入javax.ws.rs.core.Application;
@应用程序路径(“”)
公共类应用程序配置扩展应用程序{
@凌驾

public Set>resources=new java.util.HashSet您必须在web.xml中添加以下内容。看起来web.xml有点空。应该是这样的

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name>Restful Web Application</display-name>
<servlet>  
    <servlet-name>Jersey REST Service</servlet-name>  
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>  
    <init-param>  
        <param-name>jersey.config.server.provider.packages</param-name>  
        <param-value>com.services.rest</param-value>  
    </init-param>  
    <load-on-startup>1</load-on-startup>  
  </servlet>  
  <servlet-mapping>  
    <servlet-name>Jersey REST Service</servlet-name>  
    <url-pattern>/rest/*</url-pattern>  
  </servlet-mapping>  
</web-app>  

您必须在web.xml中添加以下内容。看起来web.xml有点空。它应该是这样的

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name>Restful Web Application</display-name>
<servlet>  
    <servlet-name>Jersey REST Service</servlet-name>  
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>  
    <init-param>  
        <param-name>jersey.config.server.provider.packages</param-name>  
        <param-value>com.services.rest</param-value>  
    </init-param>  
    <load-on-startup>1</load-on-startup>  
  </servlet>  
  <servlet-mapping>  
    <servlet-name>Jersey REST Service</servlet-name>  
    <url-pattern>/rest/*</url-pattern>  
  </servlet-mapping>  
</web-app>  

如果没有太多详细信息,我们将无法帮助您,请提供一些代码详细信息。我已更改了更多详细信息。谢谢如果没有太多详细信息,我们将无法帮助您,请提供一些代码详细信息。我已更改了更多详细信息。谢谢谢谢。但我正在使用RestEasy。因此这些更改对我不起作用。您必须使用与RestEasy类似,我在假设正在使用Jersey时提供。谢谢。但我正在使用RestEasy。因此,这些更改对我不起作用。您必须使用与RestEasy类似的,我在假设正在使用Jersey时提供。