无法初始化焊接

时间:2019-04-07 15:12:51

标签: cdi weld

我在Java SE项目中使用CDI使用Weld,所以一切正常,但是现在我在尝试运行代码时遇到以下错误:

avr. 07, 2019 4:55:23 PM org.jboss.weld.bootstrap.WeldStartup <clinit>
INFO: WELD-000900: 3.0.0 (Final)
avr. 07, 2019 4:55:23 PM org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create
INFO: WELD-ENV-000020: Using jandex for bean discovery
Exception in thread "main" java.lang.NoSuchMethodError: org.jboss.jandex.AnnotationTarget.asClass()Lorg/jboss/jandex/ClassInfo;
    at org.jboss.weld.environment.deployment.discovery.jandex.JandexDiscoveryStrategy.buildBeanDefiningAnnotationSet(JandexDiscoveryStrategy.java:116)
    at org.jboss.weld.environment.deployment.discovery.jandex.JandexDiscoveryStrategy.beforeDiscovery(JandexDiscoveryStrategy.java:83)
    at org.jboss.weld.environment.deployment.discovery.AbstractDiscoveryStrategy.performDiscovery(AbstractDiscoveryStrategy.java:109)
    at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:861)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:746)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:174)
    at se.Main.main(Main.java:21)

这是主类:

public class Main {
    public static void main(String[] args) throws FatalException {
        MyBean myBean;

        SeContainerInitializer initializer = SeContainerInitializer.newInstance();
        try (SeContainer container = initializer.initialize()) {//the problem is here

            myBean= container.select(MyBean.class).get();
            System.out.println(myBean.getInfo("0380093"));

        }
    }
}

我在这里想念的东西!谢谢

0 个答案:

没有答案