-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
When a REST resource is defined using a JNDI name, only one name lookup is allowed for that resource. There are cases where an EJB may have multiple views and need multiple JNDI lookups for the EJB implementation. For example, if you've got an EJB which implements multiple interfaces, each JNDI lookup name needs the interface it implements. Not all methods in the EJB implementation may belong to the same interface which could lead to issues when the wrong view is used.
An EJB example:
@Local public interface GreetEjb { String hello(); }
@Local public interface GoodbyeEjb { String goodbye(); }
@Stateless @Local({GreetEjb.class, GoodbyeEjb.class}) @Path("/") public class LocalEjbImpl implements GreetEjb, GoodbyeEjb { @Resource SessionContext ctx; @Override @GET @Path("hello") public String hello() { if (ctx == null) { return "ctx is null"; } return "Hello, World!"; } @Override @GET @Path("goodbye") public String goodbye() { if (ctx == null) { return "ctx is null"; } return "Goodbye, World!"; } }
We need to map a org.jboss.resteasy.plugins.server.resourcefactory.JndiComponentResourceFactory for the GreetEjb.hello() method and a separate one for the GoodbyEjb.goodbye() method. Each may have a EJB view and each has different JNDI lookup names.
- is related to
-
WFLY-20864 Jakarta REST applications with EJB endpoints with more than one interface results in a deployment error
-
- Pull Request Sent
-