小编kam*_*seq的帖子

使用带有wildfly 8.2的resteasy 3.0.10进行自动扫描

我正在尝试用简单的restEasy 3.0.10应用程序设置新的Wildfly 8.2服务器时弄清楚我的问题.

我的网络应用程序非常容易.

src/main/
   java/my-package/
      RootApplication.java
      HomePageResource.java
   webapp/
      index.html
      WEB-INF/
         beans.xml
         web.xml
Run Code Online (Sandbox Code Playgroud)

web.xml和beans.xml看起来像这样

---- web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1"
         xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         metadata-complete="false">
</web-app>
---- beans.xml
<beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
      http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
Run Code Online (Sandbox Code Playgroud)

在RootApplication.java我有

@ApplicationPath("/app")
public class RootApplication extends Application
{
    private Set<Object> singletons = new HashSet<>();

    public RootApplication()
    {
        singletons.add(new HomePageResource());
    }

    @Override
    public Set<Object> getSingletons()
    {
        return singletons;
    }
}

// ResourceProvider is a simple class hiding getResource and createStreamer
@Path("/")
public class HomePageResource extends …
Run Code Online (Sandbox Code Playgroud)

java jax-rs resteasy maven wildfly-8

6
推荐指数
1
解决办法
7280
查看次数

标签 统计

java ×1

jax-rs ×1

maven ×1

resteasy ×1

wildfly-8 ×1