Raj
Raj

Reputation: 2920

EJB Injection in ReSTEasy JBoss AS 7

Does anyone know if JBoss AS 7 has support for EJB injection in ReSTEasy applications per J2EE spec? I know this did not work in AS6 and was a known spec violation.

Thanks for any help/insights.

Upvotes: 1

Views: 879

Answers (1)

Rod
Rod

Reputation: 23

Yes the EJB injection is supported. I will explain a trick to put everything together to work:

  1. You have to create a file beans.xml on /Web-Inf/

  2. You have to change your Application Class. Change singletons by class.

Example:

singletos.add(new HelloResource())
replace this line by empty or clazzes.add(HelloResource.class)

After that you can use ejb injection on JBoss7 and RestEasy using ejb annotation @EJB.

Upvotes: 1

Related Questions