数码产品

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

 

posted @ 2017-11-07 21:11  Hackerman  阅读(1073)  评论(0编辑  收藏  举报
数码产品