0

I have this following code:

@Stateless
public class Service {
....

   @Inject
   private Translator <Customer> translator;

....
}


@Default
@ApplicationScoped
public class TheTranslator extends Translator <Customer> {...}

If I remove @ApplicationScoped

I get this error:

java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Translator with qualifiers @Default at injection point [BackedAnnotatedField] @Inject @Default private com.company.translator at com.companyService.translator(Service.java:0)

Sorin Penteleiciuc
  • 653
  • 1
  • 10
  • 26
  • 1
    What bean discovery mode do you have? This looks like you have implicit bean archive and the bean (without `@ApplicationScoped) has no [bean defining annotation](http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#bean_defining_annotations). If you mean it to be `@Dependent` trying using that explicitly. – Siliarus Jun 25 '18 at 10:51
  • The problem is that I use Payara. I would like to have something like a lightweight service, not a heavyweight. – Sorin Penteleiciuc Jul 06 '18 at 08:14

0 Answers0