1 Reply Latest reply on Mar 29, 2010 8:24 AM by Ales Justin

    Adding a CDI extension programatically to a deployed application

    Jozef Hartinger Master



      I have a CDI extension (.jar file) which does some integration with resteasy. I am wondering what is needed to have this extension placed in the AS so that it does not have to be placed in a deployed application. Obviously, I can put the .jar in a lib folder in the AS to have classes on the application's classpath, but that is not enough since the container won't call extension's bootstrap listeners (it will only do it for extensions packaged in WEB-INF/lib, etc..) Therefore, I need to add my extension to the deployed application at runtime somehow.


      Is it somehow possible to manipulate the deployment for the container to consider my .jar as deployed within WEB-INF/lib of the application? I guess that a custom deployer is the right place to do this, but I am not sure how to do it (perhaps a classloader or VFS manipulation?) Could you advise which API to use? Thanks in advance for responses.