wildflyweld

wildfly-preview-25.0.0.Final - ERROR Module "org.jboss.weld.core" version 3.1.5.Final


Trying to move from wildfly-25.0.0.Final (Jakarta EE 8 Full) to wildfly-preview-25.0.0.Final (Preview EE 9.1).

After adding my:

org/hibernate/ ...
org/jboss/ ...

I have WELD:

org/jboss/weld/3.1.4 ...
org/jboss/weld/4.0.0.Final ...

Error "Failed to link" at:

16:13:54,578 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 80) WFLYWS0002: Activating WebServices Extension
16:13:54,578 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 70) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
16:13:54,578 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 81) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "weld")]): java.lang.NoClassDefFoundError: Failed to link org/jboss/weld/exceptions/DeploymentException (Module "org.jboss.weld.core" version 3.1.5.Final from local module loader @7a1234bf (finder: local module finder @2f62ea70 (roots: /usr/local/Cellar/wildfly-as/wildfly-preview-25.0.0.Final/modules,/usr/local/Cellar/wildfly-as/wildfly-preview-25.0.0.Final/modules/system/layers/base))): javax/enterprise/inject/spi/DeploymentException
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
    at org.jboss.modules.Module.loadModuleClass(Module.java:753)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    at org.jboss.as.weld@25.0.0.Final//org.jboss.as.weld.WeldSubsystemAdd.performBoottime(WeldSubsystemAdd.java:86)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractBoottimeAddStepHandler.performRuntime(AbstractBoottimeAddStepHandler.java:119)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:164)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1045)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:777)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:466)
    at org.jboss.as.controller@17.0.1.Final//org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:384)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)

Can see WELD 3.1.5 @ https://weld.cdi-spec.org/news/2020/08/12/weld-315Final/

Which version of WELD should I use? 3.1.5 or 4.0.0.Final? Also where do I configure it?

(2) See 'Typo'.

Type on https://weld.cdi-spec.org/download/ for WELD 4.0.2 Finak:

WELD 4.0.2.Finak

Also error with "Download":

Not Found
The requested URL /weld/4.0.2.Finak was not found on this server.

Should be:

https://download.jboss.org/weld/4.0.2.Final/


Solution

  • Weld 4.x is the major version of Weld implementing EE 9 (e.g. with jakarta namespaces).

    However, you don't need to declare this dependency manually. WildFly always contains Weld and the EE 9 variant is no different. You can easily verify that by unpacking Wildfly distribution and looking into /modules/system/layers/base/org/jboss/weld

    (2) See 'Typo'.

    Thanks for pointing this out, I have fixed the broken link on Weld website.