19

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;
    }


}
1
  • I have same problem. Any correct response? Thanks Sep 16, 2012 at 19:36

2 Answers 2

32

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. :)

6
  • 2
    Same problem in a production system,son eclipse is not the problem :( Sep 16, 2012 at 19:37
  • 4
    Same problem in NetBeans after deploying a Singleton EJB, and this solved it for me.
    – Graham
    May 12, 2013 at 16:45
  • I also had this issue after deplying a Singleton EJB. Using EE 7 in eclipse. Mar 6, 2014 at 21:00
  • 2
    Actually this seems unrelated (or only indirectly related) to Singleton. I can reproduce it by including certain Maven projects on my path that break the deploy to glassfish with a CDI deployment failure (I think caused by annotations in the jars?). If I add, try and fail to deploy, remove, and then deploy again, I start receiving the Jax-RS EJB integration errors again. Cleaning the project and restarting glassfish resolves the issue. Mar 6, 2014 at 21:08
  • Got this problem with Glassfish 3.1.2.2, too, when redeploying a .war using Jersey with EJBs. even without Eclipse. Undeploying and deploying again did not help, but restarting Glassfish did help. Apr 22, 2016 at 14:16
0

Working solution or the ones who run the Glassfish standalone: Restart the Glassfish. Glassfish version number 4.1.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.