WELD-001408 Unsatisfied dependencies for type [PermissionResolver] with Pickelink
alexchri Nov 24, 2014 5:48 AMHi Guys,
I have created an empty project where i only have the right dependencies for Arquillian with a test class :
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.testng.Assert;
import org.testng.annotations.Test;
public class GreeterTestNG extends Arquillian {
@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class).
addClass(Greeter.class) ;
}
@Inject
Greeter greeter;
@Test
public void should_create_greeting() {
Assert.assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling"));
greeter.greet(System.out, "Earthling");
}
}
And the following dependencies :
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.1.5.Final</version>
<scope>test</scope>
</dependency>
The test works fine until i i add the following dependency :
<dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink</artifactId>
</dependency>
This is the error i get :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [PermissionResolver] with qualifiers [@Default] at injection point [[field] @Inject private transient org.picketlink.internal.AbstractIdentity.permissionResolver]
My question is : I have created my : JavaArchive without any reference to the the dependency : picketlink so why does weld try to inject things into the class : AbstractIdentity that comes from the picketlink dependency ?
This is a part of the class by the way :
public abstract class AbstractIdentity implements Identity {
private static final long serialVersionUID = 8655816330461907668L;
@Inject
private CDIEventBridge eventBridge;
@Inject
private DefaultLoginCredentials loginCredential;
@Inject
@PicketLink
private Instance<Authenticator> authenticatorInstance;
@Inject
private Instance<IdmAuthenticator> idmAuthenticatorInstance;
@Inject
private transient PermissionResolver permissionResolver;
..