0
votes

I have the following that is causing the subjected error message in APP-A

@Inject @CtcDB
private DataSource ds;

I'm using an identical pattern with APP-B which does not complain of this error. When I hover over ds in Eclipse while holding down the ctrl key, I get the following context menu for APP-B

Open @Inject Bean Resource.ds
Open Declaration
Open Declared Type

but in the APP-A with the dependency error I only get

Open Declaration
Open Declared Type

// The Resources class is basically the same b/n both apps except the qualifier is @CommitmentDB for APP-B

public class Resources {
  @Produces
  @Resource(mappedName="java:jboss/datasources/myjndids")
  @CtcDB
  private DataSource ds;

// And my annotation

@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
public @interface CtcDB{

}

I know CDI is active (I have a beans.xml in WEB-INF) because I have a POM dependency which contains some injectable beans. When hovering with the ctr key for those injections I get the expected context menu (in both apps)

1

1 Answers

0
votes

OK I figured it out myself. In the Resources class I had the wrong import for DataSource

import javax.activation.DataSource; \\instead of
import javax.sql.DataSource;

I must have clicked on the wrong Eclipse Quickfix and imported the wrong package.