3 Replies Latest reply on Mar 10, 2013 6:05 PM by Ivan Rododendro

    Forcing WELD to re-inject proxies

    Ivan Rododendro Newbie

      Hi all,

      Can someone tell me how to force weld to reinject proxies without redeploying the whole application?


      I'm deploying an ear application, with a a war containing jsf2 code, ejbs in a jar  and CDI for DI.




        • 2. Re: Forcing WELD to re-inject proxies
          Jozef Hartinger Master

          Can you explain further why would you do that?


          One possible way is to call InjectionTarget.inject() but this has various side-effects that should be considered first.

          1 of 1 people found this helpful
          • 3. Re: Forcing WELD to re-inject proxies
            Ivan Rododendro Newbie

            Hi Josef, tHank you for your response.


            I'm revisiting software architecture for a customer, switching from struts / jquery / tomcat to full jee 6 stack, the overall target is improve the productivity of next application's development. In this context, I'm investigating how to reduce (or avoid) ear (or war/ ejb ) redeployment during the development phase. I found a tool that improve JVM hot deploy features, DCEVM, it works quite well but there are some problems to fix in a jee environment.


            More precisely, when you add a method to a CDI bean, thanks to DCEVM, it's immediately visible from a java point of view. A cdi client of this modified bean will be able to call the new method if this method has been added to the interface too ( or if thre's no interface at all), but at this point I got an error because e generated proxy does not know the new method.


            Do your solution regenerate all proxies in the container and what side-effects are you talking about?


            I think it's even possible to force Weld not to cache proxies, I'll try both solutions...