You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run an embedded web server (tomcat or jetty) in a junit test. The problem is that during weld bootstrapping when starting the embedded web server it picks up jakarta.enterprise.inject.spi.Extension from the weld-se package (org.jboss.weld.environment.se.WeldSEBeanRegistrant) instead of the weld-servlet package (org.jboss.weld.module.web.WeldWebModule) which leads to the following exception:
Caused by: java.lang.RuntimeException: Service class org.jboss.weld.environment.se.WeldSEBeanRegistrant didn't implement the required interface
at org.jboss.weld.util.ServiceLoader.loadClass(ServiceLoader.java:230)
at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:210)
at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:184)
at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:164)
at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:288)
at org.jboss.weld.util.collections.ImmutableSet$BuilderImpl.addAll(ImmutableSet.java:158)
at org.jboss.weld.environment.servlet.WeldServletLifecycle.createDeployment(WeldServletLifecycle.java:275)
at org.jboss.weld.environment.servlet.WeldServletLifecycle.initialize(WeldServletLifecycle.java:153)
at org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:66)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4412)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
... 25 more
I'm trying to run an embedded web server (tomcat or jetty) in a junit test. The problem is that during weld bootstrapping when starting the embedded web server it picks up
jakarta.enterprise.inject.spi.Extension
from the weld-se package (org.jboss.weld.environment.se.WeldSEBeanRegistrant
) instead of the weld-servlet package (org.jboss.weld.module.web.WeldWebModule
) which leads to the following exception:Reproducer: https://github.com/jansohn/weld-junit5-embedded-jetty/tree/embedded-tomcat-weld-junit5
Is there any clever trick to make weld-se and weld-servlet-core on the same classloader behave correctly?
The text was updated successfully, but these errors were encountered: