Hi,
REMARK : The reason why I send you this email is that you have perhaps
experienced this problem and find a workaround. Otherwise, forget it and I
will dig into the code.
I experience a strange issue using Pax CDI, Weld 2 on Karaf. When the
BeanScanner of Pax CDI scans the classes, the class that I'm expected to
find is well scanned (org.apache.camel.cdi.internal.CamelContextMap) and is
logged
2013-11-12 13:19:31,248 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 243 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT | scanning imported package [[119.2]
osgi.wiring.package;
(&(osgi.wiring.package=org.apache.camel.cdi.internal)(version>=2.4.0)(!(version>=3.0.0)))
-> [118.5]]
But I can't retrieve it from the BundleDeployment class (used by weld) when
this method is called
--> beanDeploymentArchive.setBeanClasses(scanner.getBeanClasses()); and
this results in a NPE later on in the code
java.lang.NullPointerException
at
org.apache.camel.cdi.internal.CamelExtension.getCamelContext(CamelExtension.java:337)
at
org.apache.camel.cdi.internal.CamelExtension.startConsumeBeans(CamelExtension.java:228)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
at
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
Surprisingly, it is not listed in the beanClasses (field of BeanScanner
class)
2013-11-12 15:25:30,035 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 120 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT | candidate bean classes for bundle
[cdi-osgi [119]]:
2013-11-12 15:25:30,035 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 122 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT |
org.fusesource.workshop.cdi.beans.Service
2013-11-12 15:25:30,035 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 122 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT |
org.fusesource.workshop.cdi.beans.ServiceDecorator
2013-11-12 15:25:30,036 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 122 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT |
org.fusesource.workshop.cdi.beans.ServiceImpl
2013-11-12 15:25:30,036 | DEBUG | l Console Thread | BeanScanner
| s4j.pax.cdi.spi.scan.BeanScanner 122 | 71 -
org.ops4j.pax.cdi.spi - 0.6.0.SNAPSHOT |
org.fusesource.workshop.cdi.simple.SimpleCamelRoute
So how can we resolve this problem as the bundle 119 (= example using camel
CDI and of course CDI extension) starting a weld container (with the help
of PAX CDI) is not able to retrieve the package/class coming from camel CDI
extension : org.apache.camel.cdi.internal ?
Regards
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io