Hi Tom, You may find this interesting
https://dzone.com/articles/integrating-cdi-and-websockets Regards Jens From: Tom Barber [mailto:tom.bar...@meteorite.bi] Sent: Thursday, July 30, 2015 4:52 PM To: user@karaf.apache.org Subject: Re: PAX CDI not bootstrapping You'll cringe when you see this but I've been hacking around a bit to see whats broken: https://github.com/buggtb/broken-cdi-example/blob/master/src/main/java/com/mytool/filemanager/websocket/FileManagerEndpoint.java So I made my endpoint multipurpose and it now doubles up as a Servlet. Anyway, the get works and responds correctly with my injected CDI object, the Web socket endpoint still bombs with an NPE. I'm gonna guess its some weird Web Socket classloading issue, but I have absolutely no clue. tom On Thu, Jul 30, 2015 at 12:03 PM, Tom Barber <tom.bar...@meteorite.bi<mailto:tom.bar...@meteorite.bi>> wrote: Thanks Andreas, That was a hangover from when I tried it without an interface. I've checked it and its still not firing. Tom On Thu, Jul 30, 2015 at 11:54 AM, Andreas Kuhtz <andreas.ku...@gmail.com<mailto:andreas.ku...@gmail.com>> wrote: Hi, Might be a problem of injecting the impl instead of the interface in FileManagerEndpoint: @OsgiService private FileManagerClientImpl fileManagerClient; .. the same in the setter. Try change to FileManagerClient and see if this helps. Regards, Andreas 2015-07-30 12:48 GMT+02:00 Tom Barber <tom.bar...@meteorite.bi<mailto:tom.bar...@meteorite.bi>>: Okay gang, I've tried 0.13.0-SNAPSHOT and I still can't for the life of me figure out why I don't get my dependency injected. Here is a stripped out version: https://github.com/buggtb/broken-cdi-example I'm sure its something obvious but I can't figure it out. Thanks Tom On Wed, Jul 29, 2015 at 11:47 PM, Tom Barber <tom.bar...@meteorite.bi<mailto:tom.bar...@meteorite.bi>> wrote: Knowing my coding prowess, i wouldn't say nicely, but i'll give it a shot and ask questions another day! Thanks Achim! On Wed, Jul 29, 2015 at 11:42 PM, Achim Nierbeck <bcanh...@googlemail.com<mailto:bcanh...@googlemail.com>> wrote: If you switch to use pax-cdi 0.13.0-SNAPSHOT it'll work nicely with Pax-Web 4.x and Karaf 4. I just pushed the changes and deployed the snapshot to the ops4j snapshot repo. regards, Achim 2015-07-30 0:02 GMT+02:00 Tom Barber <tom.bar...@meteorite.bi<mailto:tom.bar...@meteorite.bi>>: Boo, actually I resolved that weirdness, that was due to me overriding the default classpath, but when it starts I don't get any beans injected which gives me a sad face....... Tom On Wed, Jul 29, 2015 at 10:38 PM, Achim Nierbeck <bcanh...@googlemail.com<mailto:bcanh...@googlemail.com>> wrote: Hi Tom, I'm not sure what happened to your setup, but actually that shouldn't be of an issue. I just tested it and stumbled over another thing. The latest pax-cdi bundles aren't compatible with Jetty 9.1 and Servlet 3.1 I'm gonna look at it. regards, Achim 2015-07-29 18:04 GMT+02:00 Tom Barber <tom.bar...@meteorite.bi<mailto:tom.bar...@meteorite.bi>>: Hello chaps Running Karaf 4 and PAX CDI I'm running into an issue wiring it all up. I have Require-Capability: org.ops4j.pax.cdi.extension; filter:="(&(extension=p ax-cdi-extension)(version>=0.12)(!(version>=0.13)))",osgi.extender; fil ter:="(osgi.extender=pax.cdi)" In my Manifest but when it starts it complains of stuff like: Caused by: java.lang.ClassNotFoundException: WEB-INFes.com.mytool.filemanager.websocket.FileManagerObj not found by com.mytool.filemanager-client Which is weird, mostly because where does WEB-IFes come from? Anyway I can't work it out, where those errors come from and whilst my bundle does come up my beans aren't injected, does anyone have a good idea? Thanks Tom -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."