1 Reply Latest reply on Aug 9, 2004 4:29 PM by Lea Thurman

    Spring LocalStatelessSessionProxyFactoryBean and Hot Deploy

    Lea Thurman Newbie

      Hi all,

      Has anyone manaed to get springs LocalStatelessSessionProxyFactoryBean class (or the Remote version) to work on hot deploy?

      I get the usual ClassCastException as soon as I fetch and cast the bean out of the Spring ApplicationContext and sure enough the reference and casting class are from difference classloaders.

      The ear is scoped and does not reference any other ear. The only thing I can think is that the spring classes are from a jar which is in the default/<config/lib and this is somehow causing it to retain a reference to the old classloader.

      Any help would be much appreciated.

      Lea.

        • 1. Re: Spring LocalStatelessSessionProxyFactoryBean and Hot Dep
          Lea Thurman Newbie

          I suspect that the LocalStatelessSessionProxyFactoryBean class and the Remote version cache classes as it seems when I hot deploy the classloader used for the cast class increases but the reference returned via the spring ApplicationContext is still from the old classloader.

          I believe (although someone with more knowledge would need to confirm) that since the spring class is loaded from a jar in the lib then this classloader is not touched on hot-deploy.

          Can anyone confirm? and if so does anyone have a workaround. I cannot think of one off the top of my head (but I cannot believe you cannot hot deploy if using spring in this way)

          ps the code I am using to locate the bean is

          BeanFactoryLocator bf = ContextSingletonBeanFactoryLocator.getInstance();

          BeanFactoryReference br = bf.useBeanFactory("com.a.b");
          ApplicationContext context = (ApplicationContext)br.getFactory();

          NotificationService svc = (NotificationService)context.getBean("NotificationService");