-
1. Re: Beginner: WELD-001408 Unsatisfied dependencies for type [SecureRandom] with qualifiers [@Default] at injection point
luksa Apr 7, 2013 6:28 PM (in response to toriacht)Since SecureRandom isn't located in a bean archive, it isn't considered as a CDI bean and cannot be injected. You must create a producer for it.
-
2. Re: Beginner: WELD-001408 Unsatisfied dependencies for type [SecureRandom] with qualifiers [@Default] at injection point
toriacht Apr 7, 2013 7:14 PM (in response to luksa)Hi Marko,
Thanks for the reply..almost there....
I created a producer like this:
@Produces
public SecureRandom produceSecureRandom(final InjectionPoint injectionPoint) {
final String injectingClass = injectionPoint.getMember().getDeclaringClass().getName();
logger.info("creating random for : " + injectingClass);
return new SecureRandom();
}
Module xml appears to be correct:
*/modules/javaee/api/main/module.xml exports as follows
<module name="javax.ws.rs.api" services="export" export="true" />
But i still get the following error:
java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl from [Module "javax.ws.rs.api:main" from local module loader @4d0ca0
What else do I need to add RuntimeDelegateImpl to classpath?
Thanks
T
-
3. Re: Beginner: WELD-001408 Unsatisfied dependencies for type [SecureRandom] with qualifiers [@Default] at injection point
toriacht Apr 8, 2013 9:24 AM (in response to toriacht)Class not found exception was due to resteasy-jaxrs being excluded from the Maven import of org.jboss.resteasy...
Thanks for the help
T