3 Replies Latest reply on Jan 22, 2013 5:49 AM by thegroove

    WELD-001408 Unsatisfied dependency

    nbhatia.bhatian.comcast.net
      I have an interface defined in JAR A:

      public interface ConfigurationService {
          String getString(String key);
      }

      I am injecting this interface in a class in JAR B:

      public class TestClass {
          @Inject private ConfigurationService configurationService;
      }

      Finally, I am implementing the interface in my WAR project:

      public class AppConfigurationService implements ConfigurationService {

          @Override
          public String getString(String key) {
              return "TEST";
          }
      }

      Unfortunately when I deploy the WAR I get the following error:

      org.glassfish.deployment.admin.DeployCommand[ 450] - Exception while loading the app : WELD-001408 Unsatisfied dependencies for type [ConfigurationService] with qualifiers [@Default] at injection point [[field] @Inject private org.archfirst.bfoms.interfaceout.exchange.trading.TestClass.configurationService]

      If I move my TestClass from JAR B to my WAR, then the error goes away. So why can't Weld resolve the dependency when TestClass is in JAR B? I have beans.xml in JAR A and B (under META-INF) and also in my WAR (under WEB-INF).

      Thanks.
      Naresh