1

I'm wanting to try out Open Web Beans 1.6.2, but the jars it lists on it's website for adding CDI support to a Java SE application

openwebbeans-spi.jar
openwebbeans-impl.jar
geronimo-jcdi_1.0_spec.jar
geronimo-atinject_1.0_spec.jar
geronimo-interceptor_1.2_spec.jar
geronimo-annotation_1.2_spec.jar

Don't seem to contain the javax.enterprise.inject.Vetoed annotation, I've had to add cdi-api 1.2 as a dependency to resolve the issue, but I'm not sure if this is correct as all other CDI dependencies were resolved by the above? Here are the dependencies I have in my pom, is this correct?

    <dependency>
        <groupId>org.apache.openwebbeans</groupId>
        <artifactId>openwebbeans-impl</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.openwebbeans</groupId>
        <artifactId>openwebbeans-spi</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jcdi_1.0_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-atinject_1.0_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-interceptor_1.2_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-annotation_1.2_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.2</version>
    </dependency>

This link seems to suggest support for @Vetoed was added in Open Web Beans 1.5.0

PDStat
  • 5,513
  • 10
  • 51
  • 86

1 Answers1

3

Please upgrade geronimo-jcdi_1.0_spec to jcdi_1.1 version

<dependency>
  <groupId>org.apache.geronimo.specs</groupId>
  <artifactId>geronimo-jcdi_1.1_spec</artifactId>
  <version>1.0</version>
</dependency>

Although your problem is weird, because you have also following entry:

<dependency>
    <groupId>javax.enterprise</groupId>
    <artifactId>cdi-api</artifactId>
    <version>1.2</version>
</dependency

which also contains @Vetoed and thus should be enough. Does maven ignore it somehow?

G. Demecki
  • 10,145
  • 3
  • 58
  • 58
  • awesome thanks, no I added cdi-api as I didn't know where the missing resource could be. I've now removed that and changed to 1.1 of jcdi and it seems to work so thanks for that! – PDStat Oct 28 '15 at 09:05