如何在WildFly上禁用WELD
作者:互联网
如何在WildFly上完全禁用WELD.我不需要它,因为我使用另一个DI框架.
Exception 0 :
javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for ‘org.springframework.data.mongodb.core.MongoOperations’ with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].
at org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension.createRepositoryBean(MongoRepositoryExtension.java:104)
at org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension.afterBeanDiscovery(MongoRepositoryExtension.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:125)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
我试过了
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:weld="http://jboss.org/schema/weld/beans"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd
http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd
http://jboss.org/schema/weld/beans ">
<weld:scan>
<weld:exclude name="com.google.**"/>
<weld:exclude name="org.springframework.data.mongodb.**"/>
</weld:scan>
但它没有解决我的问题.
解决方法:
尝试删除或注释掉$JBOSS_HOME / standalone / configuration / standalone.xml开头的扩展列表中的org.jboss.as.weld扩展名.您可能还想删除< subsystem xmlns =“urn:jboss:domain:weld:1.0”/>来自< profile>.这应该导致对服务器上部署的所有应用程序禁用Weld.
标签:java,jboss,cdi,wildfly,weld 来源: https://codeday.me/bug/20190928/1828054.html