I am trying to find out what is my problem when setting up a new Wildfly 8.2 server with a simple restEasy 3.0.10 application.
my web application is simplified.
src/main/ java/my-package/ RootApplication.java HomePageResource.java webapp/ index.html WEB-INF/ beans.xml web.xml
web.xml and beans.xml look like this
---- 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>
in RootApplication.java I have
@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; } }
but I never specified resource classes inside the application, and RestEasy could always scan WAR content. And if I remove everything from RootApplication, like this.
@ApplicationPath("/app") public class RootApplication extends Application { }
In any case, the documentation also says ( https://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/ )
Since we do not use jax-rs servlet mapping, we must define an application class annotated with the @ApplicationPath annotation. If you return an empty set for classes and singles, your WAR will be scanned for JAX-RS resources and provider resources.
any hints what can i do wrong with this simple installation ??? and one more question: I can remove beans.xml to use guice DI, I understand that this problem has nothing to do with CDI / WELD.
my pom.xml looks like
<dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-bom</artifactId> <version>3.0.10</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>jaxrs-api</artifactId> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jackson-provider</artifactId> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-multipart-provider</artifactId> </dependency> </dependencies>