I created a simple Java 11 SE maven project with Weld 3.0.5.
package main;
import javax.enterprise.inject.se.SeContainer;
import javax.enterprise.inject.se.SeContainerInitializer;
public class Main {
public static void main(String[] args){
SeContainerInitializer initializer = SeContainerInitializer.newInstance();
try (SeContainer container = initializer.initialize()) {
A a = container.select(A.class).get();
a.say();
}
}
}
Everything was fine but when I added to my project module-info.java file, weld stops working.
module glowny {
requires weld.se.shaded;
opens main to weld.se.shaded;
}
Exception:
Exception in thread "main" org.jboss.weld.exceptions.WeldException:
WELD-001524: Unable to load proxy class for bean Implicit Bean [javax.enterprise.inject.Instance] with qualifiers [@Default] with class interface javax.enterprise.inject.Instance using classloader jdk.internal.loader.ClassLoaders$AppClassLoader@2ed94a8b
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)