Can not deploy enterprise application on Payara4

Hi guys,

Please I need your thoughts, I’m currently trying to deploy an old enterprise application on Paraya4. The application is currently running fine on Glassfish3, however, deploying with Payara4 and I get the error below with the stacktrace from the server log

Error occurred during deployment: Exception while deploying the app [portal-enterprise-application] : Cannot start container(s) associated to application of type : weld.

[2022-12-08T04:07:19.996-0500] [Payara 4.1] [SEVERE] [] [javax.enterprise.system.core.ee] [tid: _ThreadID=19 _ThreadName=RunLevelControllerThread-1670490437992] [timeMillis: 1670490439996] [levelValue: 1000] [[
  Unable to start container com.sun.enterprise.web.WebContainer
MultiException stack 1 of 7
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/jboss/weld/environment/se/WeldContainer
        at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:315)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl.getAllMethods(ClassReflectionHelperImpl.java:108)
        at org.jvnet.hk2.internal.Utilities.findInitializerMethods(Utilities.java:1424)
        at org.jvnet.hk2.internal.DefaultClassAnalyzer.getInitializerMethods(DefaultClassAnalyzer.java:107)
        at org.jvnet.hk2.internal.Utilities.getInitMethods(Utilities.java:220)
        at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:145)
        at org.jvnet.hk2.internal.ClazzCreator.initialize(ClazzCreator.java:180)
        at org.jvnet.hk2.internal.SystemDescriptor.internalReify(SystemDescriptor.java:740)
        at org.jvnet.hk2.internal.SystemDescriptor.reify(SystemDescriptor.java:694)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:464)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2310)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.igdCacheCompute(ServiceLocatorImpl.java:1186)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.access$400(ServiceLocatorImpl.java:128)
        at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1180)
        at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1177)
        at org.glassfish.hk2.utilities.cache.internal.WeakCARCacheImpl.compute(WeakCARCacheImpl.java:128)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1260)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetInjecteeDescriptor(ServiceLocatorImpl.java:581)
        at org.jvnet.hk2.internal.ServiceLocatorImpl.getInjecteeDescriptor(ServiceLocatorImpl.java:590)
        at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:70)
        at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212)
        at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:235)
        at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358)
        at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
....
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/jboss/weld/environment/se/WeldContainer
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.get(LRUHybridCache.java:164)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:303)
        ... 49 more
Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/environment/se/WeldContainer
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.getDeclaredMethods(Class.java:1975)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:108)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$3.run(ClassReflectionHelperUtilities.java:104)
        at java.security.AccessController.doPrivileged(Native Method)
...
      ... 65 more
MultiException stack 2 of 7
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Lorg/jboss/weld/environment/se/WeldContainer;
        at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:315)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperImpl.getAllFields(ClassReflectionHelperImpl.java:113)
...
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Lorg/jboss/weld/environment/se/WeldContainer;
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.get(LRUHybridCache.java:164)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:303)
        ... 49 more
Caused by: java.lang.NoClassDefFoundError: Lorg/jboss/weld/environment/se/WeldContainer;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
        at java.lang.Class.getDeclaredFields(Class.java:1916)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$4.run(ClassReflectionHelperUtilities.java:119)
        at org.glassfish.hk2.utilities.reflection.internal.ClassReflectionHelperUtilities$4.run(ClassReflectionHelperUtilities.java:115)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
        at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
        ... 49 more
Caused by: java.lang.ClassNotFoundException: org.jboss.weld.environment.se.WeldContainer not found by org.glassfish.main.appclient.gf-client-module [63]


Are you starting a CDI-Container programmatically? It looks like because of the need for the “org/jboss/weld/environment/se/WeldContainer” class, which is not needed in a JakartaEE-environment.

Hi UlrishC,

Thank you for your response.

No I am not starting a CDI-Container programmatically. Could this be from added 3rd party libraries/module?

Regards,
Zubair