[weld-dev] Fwd: Issue with weld 2.1.0.Final on OSGI
Charles Moulliard
cmoulliard at redhat.com
Sat Nov 9 05:31:15 EST 2013
Done a comparaison between beanTypes resolved when running a junit test
using weld 2.1.0.Final + DeltaSpike + camel vs Weld 2.1.0.Final + Camel
+ PaxCDI on Karaf and it appears that my class CamelContextBean is not
listed. This is why I get a NPE. So I supect again a classloading issue
when WeldContainer loads the classes of a bundle including also classes
to be imported from another bundle ....
https://gist.github.com/7384007 <https://gist.github.com/7384007>
On 08/11/13 19:15, Charles Moulliard wrote:
> 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 at redhat.com>
> To: weld-dev at lists.jboss.org, Antoine Sabot-Durand
> <asabotdu at redhat.com>, Jason Porter <jporter at redhat.com>, Peter Muir
> <pmuir at 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20131109/c0465252/attachment.html
More information about the weld-dev
mailing list