As per the Weld 2642 issue, and per the last PR for GF which attempted to update various versions, Weld 4.0.0.Beta1 and Weld 4.0.0.Beta2 do not work with GlassFish. For instance, in the CDI_ALL tests there are tons of exceptions like these:
[exec] Caused by: java.lang.reflect.UndeclaredThrowableException
[exec] at com.sun.proxy.$Proxy280.create(Unknown Source)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:498)
[exec] at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:113)
[exec] at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:143)
[exec] at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:492)
[exec] at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:163)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1520)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:1396)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleInput(MessageMediatorImpl.java:901)
[exec] at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:183)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:665)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.dispatch(MessageMediatorImpl.java:467)
[exec] at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.doWork(MessageMediatorImpl.java:2193)
[exec] at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:467)
[exec] at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:510)
[exec] Caused by: jakarta.ejb.CreateException: ERROR creating stateful SessionBean
[exec] at com.sun.ejb.containers.StatefulSessionContainer.createRemoteBusinessObjectImpl(StatefulSessionContainer.java:662)
[exec] at com.sun.ejb.containers.EJBHomeImpl.createRemoteBusinessObjectImpl(EJBHomeImpl.java:97)
[exec] at com.sun.ejb.containers.EJBHomeInvocationHandler.invoke(EJBHomeInvocationHandler.java:158)
[exec] ... 18 more
[exec] Caused by: java.lang.reflect.InvocationTargetException
[exec] at com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(BaseContainer.java:1710)
[exec] at com.sun.ejb.containers.StatefulSessionContainer.createBeanInstance(StatefulSessionContainer.java:770)
[exec] at com.sun.ejb.containers.StatefulSessionContainer.createRemoteBusinessObjectImpl(StatefulSessionContainer.java:649)
[exec] ... 20 more
[exec] Caused by: java.lang.NullPointerException
[exec] at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
[exec] at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:1169)
[exec] at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:201)
[exec] at org.glassfish.weld.services.JCDIServiceImpl.createInterceptorInstance(JCDIServiceImpl.java:384)
[exec] at com.sun.ejb.containers.BaseContainer.createEjbInterceptors(BaseContainer.java:1756)
[exec] at com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(BaseContainer.java:1687)
[exec] ... 22 more