小编use*_*758的帖子

Apache Tomcat 7.0.47上的BeanManager无法创建资源实例

运行:Apache Tomcat 7.0.47 OmniFaces 1.6.3 JSF Mojarra 2.1.26 CDI Weld 2.1.0.Final

RuntimeException通过访问JNDI"java:comp/BeanManager",Threre是Apache Tomcat 7.0.47上的一个.CDI BenManager必然会java:comp/env/BeanManager在您的BeanManager类中无法到达.

  /**
         * Perform automatic initialization whereby the bean manager is looked up from the JNDI. If the bean manager is
         * found, then invoke {@link #init(Object)} with the found bean manager.
         */
        private void init() {
                if (!initialized.getAndSet(true)) {
                        try {
                                Class.forName("javax.enterprise.inject.spi.BeanManager"); // Is CDI present?
                                Class.forName("javax.naming.InitialContext"); // Is JNDI present? (not on Google App Engine)
                        }
                        catch (Exception e) {
                                return; …
Run Code Online (Sandbox Code Playgroud)

jsf tomcat cdi omnifaces weld

5
推荐指数
1
解决办法
5339
查看次数

标签 统计

cdi ×1

jsf ×1

omnifaces ×1

tomcat ×1

weld ×1