Peter Eriksson
Peter Eriksson

Reputation: 239

How are you supposed to access EJB when using Easyrest?

I have been trying to get Resteasy to work (and not it dose). However I now have another headache with accessing the EJB:s. I have tried injecting them, looking them up with jndi and most other solutions but none of them works.

I get massages like: java.lang.RuntimeException: Class is not a root resource.

Or: java.lang.IllegalArgumentException: Wrong target.

Or just: NullPointer

Using JBoss 5.1.0.GA and Resteasy 1.2.1.GA... Can't find any documentation on how this could be done. Do anybody know?

Upvotes: 1

Views: 964

Answers (1)

Luca Molteni
Luca Molteni

Reputation: 5370

Have you seen this: EJB Integration?

Resteasy currently only has simple integration with EJBs. To make an EJB a JAX-RS resource, you must annotate an SLSB's @Remote or @Local interface with JAX-RS annotations:

Next, in RESTeasy's web.xml file you must manually register the EJB with RESTeasy using the resteasy.jndi.resources

Upvotes: 1

Related Questions