2 Replies Latest reply on Mar 17, 2006 12:41 AM by asack

    Rebinding EJB3 JNDI namespace

    asack

      I'm experimenting and I want to know if rebinding an EJB3's JNDI location a bad thing?

      I want to manage my EJB3 proactively and one of the issues is JNDI namespace collisions (foreign deployments interacting with my stuff that have similar names).

      I have some code that rebinds a STSB EJB3's JNDI location. That works, but unfortunately the bean never gets removed from JNDI during undeployment (I will guess its because I changed it underneath at @PostConstruct time). I initially tried to use the @PreDestroy lifecycle callback but that won't work either. since apparently STSBs never get destroyed during runtime.

      Am I just barking up the wrong tree here? I would rather proactively manage namespace than rely on @RemoteBinding/LocalBinding annotations.

      -aps

        • 1. Re: Rebinding EJB3 JNDI namespace
          bill.burke

          a SFSB gets removed from JNDI at undeployment. If it didn't redeploy would never work. I don't think it cleans up the Context dirs though.

          • 2. Re: Rebinding EJB3 JNDI namespace
            asack

             

            "bill.burke@jboss.com" wrote:
            a SFSB gets removed from JNDI at undeployment. If it didn't redeploy would never work. I don't think it cleans up the Context dirs though.


            Bill, I will double check for ya but so far my experience has been if I rebind an EJB3 and then remove the jar, i.e. undeploy, the Bean still exists in JNDI space (plus the Context dirs). Then if I redeploy I get a JNDI name already bound exception (when I rebind the SLSB again).

            I really need that @PreDestory callback... ;-)!

            -aps