質問


I have a Java EE 6 CDI based application running on JBoss AS 7.1.1 which contains some Session Beans too.

@Stateless
public class OrderService   {
@Inject
private Logger log;

@Inject
private EntityManager em;

    . . . . .

}

Everything worked fine until I had to expose my SLSB as a SOAP Web Service. So I had to provide an interface and declare the Web service:

@Stateless
@Remote(OrderServiceItf.class)
@WebService
public class OrderService implements OrderServiceItf  {

@Inject
private Logger log;

@Inject
private EntityManager em;

    . . . . .
}

@WebService
public interface OrderServiceItf  {
. . . .
}

Unfortunately once I deploy the application I get the following WELD exception whereever I use this Bean: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [OrderService] with qualifiers [@Default] at injection point [[field] @Inject com.telco.service.SendMessageService.orderService]

public class SendMessageService implements Serializable {
@Inject
private Logger logger;

int money;
@Inject OrderService orderService;

}

Any help how can I sort out this issue ? Thanks a lot!

役に立ちましたか?

解決

You can use @Typed(OrderService) and you should be good. This changes the metadata for that bean and instead of being of the interface type, CDI will recognize your EJB as the concrete type.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top