Este contenido no está disponible en el idioma seleccionado.
Chapter 34. EJB Integration
To integrate with Enterprise JavaBeans (EJB), you must first modify your EJB's published interfaces. Currently, RESTEasy only has simple portable integration with EJBs, so you must manually configure your RESTEasy
WAR
.
To make an EJB a JAX-RS resource, annotate a stateless session bean's
@Remote
or @Local
interface with JAX-RS annotations, as follows:
Next, in RESTEasy's
web.xml
, manually register the EJB with RESTEasy by using the resteasy.jndi.resources <context-param>
:
At present, this is the only portable integration method for EJBs. Future versions of RESTEasy will be more tightly integrated with JBoss AS, so manual registrations and modifications to
web.xml
will be unnecessary.
If you are using RESTEasy with an
EAR
and EJBs, the following structure is helpful:
Remove all libraries from
WEB-INF/lib
and place them in a common EAR
library, or place the RESTEasy JAR
dependencies in your application server's system classpath (that is, in JBoss AS, place them in server/default/lib
).