Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable WELD on WildFly

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

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)

I tried

<?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.

like image 653
Rinat Mukhamedgaliev Avatar asked Feb 13 '14 14:02

Rinat Mukhamedgaliev


People also ask

How do you disable Weld?

Usually, you can undo welding using torch cutting, plasma cutting, drills, grinding or circular saws, or oxy-acetylene torches. There are a couple of ways to perform this other than just applying a strong force to the weld. The procedure of removing welds relies on the weld type you would like to undo.

What is Jboss welding?

Weld is the reference implementation of CDI: Contexts and Dependency Injection for the Java EE Platform - a JCP standard for dependency injection and contextual lifecycle management and one of the most important and popular parts of the Java EE.


1 Answers

There's the standard way:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
                       http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
   version="1.1" bean-discovery-mode="none">
</beans>
like image 104
Yuri Avatar answered Nov 16 '22 01:11

Yuri