Announcement Announcement Module
Collapse
No announcement yet.
Spring webapp, EJB backend redeployed: NoSuchEJBException? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring webapp, EJB backend redeployed: NoSuchEJBException?

    Folks;

    maybe an obvious thing I ran into: Having a Spring/MVC based webapp built against a couple of backend services being stateless EJBs, things work pretty good - except for having the backend application redeployed without redeploying the webapplication as well, which then is likely to cause any EJB calls end up in NoSuchEJBException's being thrown. Somehow I am not surprised to see this happen (given the EJB references obviously are injected along with the Spring application context startup), still the question: Is there a way to, in such a setup, avoid having to redeploy the webapp as well?

    TIA and best regards,
    Kristian

  • #2
    I realise this is a very old thread, but did anyone find the solution to this problem? Rebuilding the flow somehow seems to help? Eg, if I start a new flow, it picks up the new EJB, while reusing the current flow doesn't.

    Edit: In my case, we were looking up the EJB in an Action constructor instead of in the setupForm method, so when the new form got setup it was using a stale EJB reference. It's important to keep in mind when the objects you're working with are being instantiated...
    Last edited by richard.barrington; Jul 20th, 2009, 01:09 AM. Reason: Solution

    Comment


    • #3
      Hi Richard;

      Originally posted by richard.barrington View Post
      I realise this is a very old thread, but did anyone find the solution to this problem? Rebuilding the flow somehow seems to help? Eg, if I start a new flow, it picks up the new EJB, while reusing the current flow doesn't.
      as far as I am concerned, I have seen two approaches to resolving this:

      (a) As someone on the glassfish mailing list recommended, I wrapped up the EJB access into some getter method and programmatically check whether the EJB reference is still valid before using it, eventually trying to reconnect it before that. This is what we do at the moment, and it seems to work.

      (b) A solution that (along with Spring) seems more "elegant" yet I haven't found the time to test-drive is documented here: http://java.dzone.com/tips/configure...-automatically - maybe this is more what you want/need.

      Cheers,
      Kristian

      Comment

      Working...
      X