-
1. Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
bmajsak Nov 4, 2013 8:48 AM (in response to kjoymungol)Do you have any producer method which instantiates the logger? From where is it coming from?
-
2. Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
kjoymungol Nov 5, 2013 1:10 AM (in response to bmajsak)The logger is from the slf4j library. I could have used something like private Logger log = LoggerFactory.getLogger(Greeter.class) to instantiate, but I see with any injected classes from a library, I get the same error.
-
3. Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
kjoymungol Nov 5, 2013 1:57 AM (in response to kjoymungol)For example if am injecting the javax.persistence.EntityManager in the Greeter.class, I get the same error. Am new to java/jboss. Am using version 7.
-
4. Re: Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
bmajsak Nov 5, 2013 3:41 AM (in response to kjoymungol)Hi Kevin,
I'm not sure if @Inject for logger will work out of the box. You need to provide @Produces method or something similar where you actually create the logger like you mentioned in the post above (but only in once place - for the type you are about to inject your logger to you can use InjectionPoint class which will give you this information), so for example create additional CDI bean with following method:
@Produces public Logger createLogger(InjectionPoint ip) { return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); // or sth similar, depends on your implementation }
For having an access to entity manager, you need to add persistence.xml to your test deployment in order to have JPA enabled.
Hope that helps.
Cheers,
Bartosz
-
5. Re: Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
kjoymungol Nov 5, 2013 8:45 AM (in response to bmajsak)Thanks Bartosz.
Am getting another error, below, when deploying a test.
java.lang.ClassNotFoundException: org.jboss.as.osgi.OSGiConstants from [Module "deployment.arquillian-service:main" from Service Module Loader]
Any ideas what may cause this?
-
6. Re: Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
bmajsak Nov 5, 2013 8:48 AM (in response to kjoymungol)I think the easiest would be to share your project over github so I can fork and make a pull request when fixed. Can you share it this way?
-
7. Re: Re: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private org.arquillian.example.Greeter.log] error
kjoymungol Nov 6, 2013 8:25 AM (in response to bmajsak)Forget about the last question. Ur tip about the logger really helped. Thanks a lot Bartosz Majsak...