I am trying a simple app using Jersey JAX-RS + EJB 3.1 on GlassFish 3.1.2.2. All seemed to look pretty well with Jersey REST on GlassFish until I added EJB. When deploying the war file, I got this error.
SEVERE: Error when configuring to use the EJB interceptor binding API. JAX-RS EJB support is disabled.
Anyone who has encountered this before? Is there a configuration in GlassFish to fix this?
My EJB is a simple pojo with @Singleton
and @PostConstruct
annotation.
@Singleton
public class PurchaseBean {
private String name;
@PostConstruct
public void init() {
System.out.println("Initializing PurchaseBean");
setName("Purchase Singleton EJB");
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Looks like this is an Eclipse issue. I did the deployment using Eclipse with the GlassFish adapter. Restarting Eclipse solved it.
Solution: Shutdown GlassFish, inside Eclipse go to Project->Clean(select project) and then start GlassFish again.
I don't know why but it worked. :)