FYI
-------- Original Message --------
Subject: Issue with weld 2.1.0.Final on OSGI
Date: Fri, 08 Nov 2013 19:11:59 +0100
From: Charles Moulliard <cmoulliard@redhat.com>
To: weld-dev@lists.jboss.org, Antoine Sabot-Durand <asabotdu@redhat.com>, Jason Porter <jporter@redhat.com>, Peter Muir <pmuir@redhat.com>
Hi,
The following code which is working fine and returns a bean when we run
Junit Test with DeltaSpike does not work when Weld 2.1.0.Final is
deployed on Karaf (OSGI v4.3) with Pax-CDI. Apparently the bean is not
retrieved when we call "beanManager.getBeans("
protected CamelContext getCamelContext(String context, BeanManager
beanManager) {
if (camelContextMap == null) {
Set<Bean<?>> beans =
beanManager.getBeans(CamelContextMap.class, new AnyLiteral()); // return
null
Bean<?> bean = beanManager.resolve(beans); // return null
CreationalContext<?> creationalContext =
beanManager.createCreationalContext(bean);
camelContextMap = (CamelContextMap)
beanManager.getReference(bean, bean.getBeanClass(), creationalContext);
ObjectHelper.notNull(camelContextMap, "Could not resolve
CamelContextMap");
}
return camelContextMap.getCamelContext(context);
}
Question : How does WeldContainer loads the class when we use getBeans
as I suspect that we have a problem with the classloader used ?
Regards,
Charles