Skip to content

Instantly share code, notes, and snippets.

@dmikurube
Created March 25, 2015 19:41
Show Gist options
  • Select an option

  • Save dmikurube/02394d72993a23c51dac to your computer and use it in GitHub Desktop.

Select an option

Save dmikurube/02394d72993a23c51dac to your computer and use it in GitHub Desktop.
Guice and CDI on RESTEasy (WildFly 8.2.0.Final and RESTEasy 3.0.10.Final)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.dmikurube</groupId>
<artifactId>guice-cdi-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Guice and CDI test</name>
<dependencies>
<!--
Enabling this cdi-api or creating src/main/webapp/WEB-INF/beans.xml will
cause Weld's DeploymentException.
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Injector with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.parentInjector
at org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.parentInjector(GuiceResteasyBootstrapServletContextListener.java:0)
-->
<!--
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>compile</scope>
<version>1.2</version>
</dependency>
-->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
<version>3.0.10.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.10.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-guice</artifactId>
<version>3.0.10.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment