views:

165

answers:

1

I would like to have the following kind of resource class work when deployed under RestEasy in JBoss 6:

@Path("Something")
public class Foo {

  @EJB
  private SomeService service

  @GET
  public Object frobnicate() {
    assert service != null;
    // JBoss blows up here

    return result;
  }
}

Two questions:

  1. It is a limitation of RestEasy, not of the Java EE specification, right, that RestEasy can't inject anything annotated with @EJB?
  2. What have people done to work around this limitation?

My developers are about to surge forward with hard-coded JNDI lookups (e.g. context.lookup(someHardCodedNameHere)) because no one can find a workaround to this specification violation at the present time. I really want to avoid this.

Lastly, I've looked at using CDI, but the story here isn't much better as RestEasy and CDI still aren't talking to each other.

Thanks in advance for any pointers.

A: 

The JBoss guys tell me this is being worked on on the trunk. So as of JBoss 6 milestone 3 this is impossible.

Laird Nelson