How to disable WELD on WildFly

前端 未结 3 838
礼貌的吻别
礼貌的吻别 2020-12-08 23:50

How to fully disable WELD on WildFly. I don\'t need it, because I use another DI framework.

Exception 0 : javax.enterprise.inject.UnsatisfiedResolut

3条回答
  •  清歌不尽
    2020-12-09 00:19

    Option 1: jboss-all.xml in the war

    This is Weld-specific, but it disables Weld's automatic bean scanning for an entire deployment (eg a war file and all the jars inside it). This is handy when you can't easily add beans.xml to a third-party jar, such as jboss-seam-resteasy.jar.

    Save as WEB-INF/jboss-all.xml for wars, META-INF/jboss-all.xml otherwise:

    
        
    
    

    See Per-deployment configuration.

    Option 2: standalone.xml in WildFly

    Another option, which doesn't require changing the application itself, is to configure the weld subsystem not to treat random jars as CDI libraries. Just edit the configuration for weld in WildFly's standalone.xml to look like this:

    
    

提交回复
热议问题