users@glassfish.java.net

Problem with JAXRS+JAXWS+Stateless EJB together on GFV3 Preview

From: Paulo Cesar Reis <casmeiron_at_gmail.com>
Date: Tue, 20 Oct 2009 21:02:22 -0200

Hi,

Iıve tried to put on same class a stateless ejb with jaxrs and jaxws.
Example:

@Stateless
@Path(³root²)
@WebService
public class RootResource {
   @GET
  @WebMethod
   public String get() { return ³lol²; }
}

With this configuration GF says that webservice must have an interface, ok I
did that:
...
public class RootResource implements NullInterface {
...
}

So the app could be deployed. When tryinı to access the resource by REST,
jersey threw exception sayinı:

³the object is not instance of declaring class²

So I realize that whether I take off the interface (and also the @webservice
annotation) everythinı works. I also tried the Resource without EJB (and
without jaxws) annotation implementing an interface and everythinı works.
Then, I realize the problem is within EJB+Rest+interface, its seems that
jersey cannot handle it, eg:

@Stateless
@Path(³root²)
Public class RootResource implements NullInterface {
 @GET
public String get( ) { return ³no you donıt!²; }
}

Anyone can give me a hint about this problem? Itıs look like a bug to me.

Thanks.