[jboss-jira] [JBoss JIRA] (WFLY-1960) CDI @Inject of @Stateless @WebService cause WELD-001408 Unsatisfied dependencies

Aslak Knutsen (JIRA) jira-events at lists.jboss.org
Tue Aug 27 07:39:26 EDT 2013


Aslak Knutsen created WFLY-1960:
-----------------------------------

             Summary: CDI @Inject of @Stateless @WebService cause WELD-001408 Unsatisfied dependencies
                 Key: WFLY-1960
                 URL: https://issues.jboss.org/browse/WFLY-1960
             Project: WildFly
          Issue Type: Bug
          Components: CDI / Weld, EJB, Web Services
    Affects Versions: 8.0.0.Alpha4
            Reporter: Aslak Knutsen
            Assignee: Jozef Hartinger


CDI @Inject of @WebService does not work. 

{code}
import javax.ejb.Stateless;
import javax.jws.WebService;
 
@Stateless
@WebService
public class TestBean {
}
 
 
import javax.inject.Inject;
 
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;
 
 
@RunWith(Arquillian.class)
public class TestBeanIT {
 
    @Inject
    TestBean bean;
 
    @Deployment
    public static WebArchive createDeployment() {
        WebArchive arch =  ShrinkWrap.create(WebArchive.class);
        arch.addClass(TestBean.class);
        arch.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
        return arch;
    }
 
    @Test
    public void fooTest() throws Exception {
 
    }
}
{code}

Using CDI to do a non contextual injection on a class where @EJB is used instead of @Inject works.

{code}
@RunWith(Arquillian.class)
public class TestBeanIT {
 
    @EJB
    TestBean bean;
    ...
}
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list