问题描述
如何在 WildFly 上完全禁用 WELD.我不需要它,因为我使用了另一个 DI 框架.
How to fully disable WELD on WildFly. I don't need it, because I use another DI framework.
异常 0:javax.enterprise.inject.UnsatisfiedResolutionException:无法使用限定符 [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default() 解析org.springframework.data.mongodb.core.MongoOperations"的 bean)].在 org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension.createRepositoryBean(MongoRepositoryExtension.java:104)在 org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension.afterBeanDiscovery(MongoRepositoryExtension.java:79)在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在 java.lang.reflect.Method.invoke(Method.java:606)在 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)在 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)在 org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:125)在 org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)在 org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)在 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>
但这并没有解决我的问题.
But it did not resolve my problem.
推荐答案
尝试删除或注释掉 $ 开头的扩展列表中的
.您可能还想从 org.jboss.as.weld
扩展JBOSS_HOME/standalone/configuration/standalone.xml 中删除
.这应该会导致对部署在服务器上的所有应用程序禁用 Weld.
Try deleting or commenting out the org.jboss.as.weld
extension in the extensions list on the beginning of $JBOSS_HOME/standalone/configuration/standalone.xml
. You may also want to delete <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
from <profile>
. This should cause disabling Weld for all applications deployed on the server.
这篇关于如何在 WildFly 上禁用 WELD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!