1

I'm running into an issue trying to migrate an application from Jboss AS6 to Wildfly. The application consists of a 'Product' ear, a 'Person' ear, and a 'Common' jar containing shared interfaces and utilities. All are being deployed as modules on a Wildfly application server. I need to be able to inject a service bean defined in Person into Product. The LoginService bean is located in Person and looks like this:

@Stateless
@Remote(LoginService.class)
public class LoginServiceBean implements LoginService {
@Resource
    protected SessionContext context;
}

When I build and deploy the Person ear, I get the following log for my jndi bindings:

    java:global/Person/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService
    java:app/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService
    java:module/LoginServiceBean!com.tura.common.service.login.LoginService
    java:jboss/exported/Person/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService
    ejb:Person/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService
    java:global/Person/Person-ejb/LoginServiceBean
    java:app/Person-ejb/LoginServiceBean
    java:module/LoginServiceBean

In the Product project I then have a stateless EJB bean

@Stateless(name = "ClientServiceProvider")
public class ClientServiceProviderBean implements ClientServiceProvider{
    @EJB(name = "ejb:Person/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService")
    protected LoginService loginService;
}

When I try to deploy, it then fails with the error:

No EJB found with interface of type 'com.tura.common.service.login.LoginService' for binding ejb:Person/Person-ejb/LoginServiceBean!com.tura.common.service.login.LoginService"

I've tried every binding configuration I can think of; nothing seems to work. All the documentation I can find seems to want to use a manual jndi lookup rather than the annotation. What am I doing wrong here? Is there really no way to inject services between EARs?

pbuchheit
  • 1,371
  • 1
  • 20
  • 47

0 Answers0