0


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!

Max Korn
  • 275
  • 7
  • 17
  • I just checked injecting **EJB** instead of **Inject** into my SendMessageService and it seems to work. (Hope I haven't broken the rest of the application.). Are there other options available out there ? Thanks – Max Korn Jan 12 '13 at 08:05

1 Answers1

1

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.

LightGuard
  • 5,068
  • 15
  • 18