Wildfly Resteasy 给我 404 错误并且没有日志记录

Wildfly Resteasy gives me 404 error and no logging

我有一个非常简单的 RESTeasy 示例 运行 Mac 上的 wildfly 8.2。

它只包含两个类:

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

@ApplicationPath("/")
public class RestApp extends Application {
}

=

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/test")
@Stateless
@LocalBean
public class TestTheRest extends Application {

   @GET
  @Produces({MediaType.APPLICATION_JSON})
   public Response getBookingDetails() {
        String hello = "Hi";
        return Response.ok(hello).build();
  }

}

浏览到 /warname 给了我 "forbidden" 这应该没问题,而尝试使用“/warname/test”将 return 找不到 404。同样在 server.log 中,我在发出请求时什么也看不到 ?? 我在这里错过了什么吗?

[0m [0m19:03:54,777 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017534: Registered web context: /logicshop
[0m [0m19:03:54,814 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "logicshop.war" (runtime-name : "logicshop.war")
[0m [0m19:03:54,823 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
[0m [0m19:03:54,823 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
[0m [0m19:03:54,823 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.0.Final "Tweek" started in 3018ms - Started 262 of 317 services (92 services are lazy, passive or on-demand)
[0mConnected to server
[2015-01-15 07:03:54,836] Artifact logicshop: Artifact is being deployed, please wait...
[0m19:03:54,899 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) JBAS017535: Unregistered web context: /logicshop
[0m [0m19:03:54,918 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.1.3.Final
[0m [0m19:03:54,966 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015877: Stopped deployment logicshop.war (runtime-name: logicshop.war) in 71ms
[0m [0m19:03:55,013 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018558: Undeployed "logicshop.war" (runtime-name: "logicshop.war")
[0m [0m19:03:55,079 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015876: Starting deployment of "logicshop.war" (runtime-name: "logicshop.war")
[0m [0m19:03:55,138 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) JBAS017534: Registered web context: /logicshop
[0m [0m19:03:55,149 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "logicshop.war" (runtime-name : "logicshop.war")
[0m[2015-01-15 07:03:55,165] Artifact logicshop: Artifact is deployed successfully
[2015-01-15 07:03:55,165] Artifact logicshop: Deploy took 329 milliseconds

我有一些具有休眠依赖项的 dao 和实体。 我删除了那些,现在可以使用了 ??

好吧,最后我发现如果将 persistence.xml 放在 "WEB-INF" 而不是 "META-INF" 中,就会发生这种行为。现在可以了。