java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;

Posted Sharplee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;相关的知识,希望对你有一定的参考价值。

java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;

删除Struts2-cdi-plug 的插件的jar包,以及struts2插件的jar包。

 

 

question:

When I build this test application and deploy to Tomcat 7, page loading attempt gives
java.lang.ClassNotFoundException: javax.enterprise.context.spi.Contextual
I tried adding dependency for cdi-api. ClassNotFoundException goes away but then I get javax.naming.NameNotFoundException: Name [BeanManager] is not bound in this Context. Unable to find [BeanManager].
I have the same problem with my own Vaadin 7 application using cdiutils. Any help would be appreciated.

 

ask:

Tomcat doesn‘t provide a CDI container per se. Surely you can include one manually but it‘s easier just to deploy to a Java EE compatible web app server such as TomEE: http://tomee.apache.org/apache-tomee.html

 




以上是关于java.lang.NoClassDefFoundError: Ljavax/enterprise/inject/spi/BeanManager;的主要内容,如果未能解决你的问题,请参考以下文章