catch (NamingException e)
{
//fallback for a servlet container
BeanManagerImpl beanManager = getWebBeansContext().getBeanManagerImpl();
Iterator<Bean<?>> beansIterator = beanManager.getBeans(resourceType, new DefaultLiteral()).iterator();
if (!beansIterator.hasNext())
{
logger.log(Level.SEVERE, "can't find ejb (via jndi) or cdi bean for type " + resourceType.getName(), e);
throw new RuntimeException("can't find ejb (via jndi) or cdi bean for type "