2 Replies Latest reply on Oct 17, 2008 6:29 PM by Ben Catherall

    Access Session bean from other session bean

    Jon Hatfield Newbie
      Hello,

      I am trying to call a method in a session bean, currently instantiated in the session, from another bean. Not sure if this is even possible... Using the following code I can almost access the object:

      Object o = Contexts.getConversationContext().get(JobManager.class);

      However, this object is of type javassist and an exception occurs if I try to cast this object and call one of its methods as follows:

      ((JobManager)o).refresh();

      Alternatively, a page refresh from a commandButton method would also solve my problem - what is happening is that I am using a new bean to populate an icefaces popup, and when it is closed, I want the original page, handled by a different bean, to refresh. So far, with this alternative approach, the best solution I have is a double re-direct in faces-config away from and back to the page, which forces a full page refresh - though this is without ajax partial-submit and less smooth.

      Any help on either calling another bean or refreshing the current page would be appreciated.

      Thanks very much,

      Jon