My Oracle Support Banner

GlassFish Server Call To An EJB That Is Injected With @Inject Fails For An EJB That Has Superinterfaces (Doc ID 1621129.1)

Last updated on FEBRUARY 24, 2017

Applies to:

Oracle GlassFish Server - Version 3.1.2 to 3.1.2 [Release 3.1]
Information in this document applies to any platform.

Symptoms

Having:

1) The superinterface:

public interface SomeGenericInterface {
    public void doSomething;
}

2) The interface (that is a local interface) that extends the superinterface:

@Local
public interface SomeDirectLocalInterface extends SomeGenericInterface {...}

3) The EJB class implementing the local interface:

@Stateless(name = "SomeDirectLocalInterface")
public class SomeEjb implements SomeDirectLocalInterface {..}


When this bean is injected with @Inject and one of the superinterface methods is called:

public class SomeBean {

    @Inject
    SomeDirectLocalInterface myBean;

    public void do() {
        myBean.doSomething();
    }
}

the call fails with the following exception:

java.lang.IllegalStateException: Unable to convert ejbRef for ejb SomeDirectLocalInterface to a business object of type interface
com.test.SomeGenericInterface
    at com.sun.ejb.containers.EjbContainerServicesImpl.getBusinessObject(EjbContainerServicesImpl.java:114)
    at org.glassfish.weld.ejb.SessionObjectReferenceImpl.getBusinessObject(SessionObjectReferenceImpl.java:63)
    at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:108)
...

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.