WELD-001300 when searching for BeanManager from JNDI

I configured Jetty 9.2.5 + Weld 2.2.7 (currently the latest versions) as described in the Welding Documentation .

Everything works fine except for the BeanManager JNDI search. Finding other JNDI entries works as expected. I got an error (note that this is not javax.naming.NameNotFoundException )

 javax.naming.NamingException: WELD-001300: Unable to locate BeanManager 

The code I'm using is:

 BeanManager beanManager = null; try { final Context ctx = new InitialContext(); try { // JNDI name defined by spec beanManager = (BeanManager) ctx.lookup("java:comp/BeanManager"); } catch (NameNotFoundException nf1) { try { // JNDI name used by Tomcat and Jetty beanManager = (BeanManager) ctx.lookup("java:comp/env/BeanManager"); } catch (NameNotFoundException nf2) { } } } catch (NamingException ex) { System.err.println(ex); } return beanManager; 

The full test code can be found at https://github.com/rmuller/java8-examples/tree/master/jetty-maven-cdi

+2
source share
1 answer

This has similar symptoms with the problem I encountered with Tomcat 7/8 and Weld 2.2.6. In my case, this was due to an error in WELD, which was fixed in 2.2.7. Therefore, it should not affect the initial setting of the poster.

https://issues.jboss.org/browse/WELD-1776

0
source

All Articles