Hi Robert, > -----Original Message----- > From: Robert A. Decker [mailto:[email protected]] > Sent: Tuesday, June 26, 2012 1:35 AM > To: [email protected] > Subject: How to debug adapterfactory? > > Hi, > > I've written an AdapterFactory that appears to be set up correctly. It > shows up in my services and has adaptables and adapters. And when I > look under the System Console 'Sling Adapters' tab it shows up as well > with the proper values under the Adaptable Class column and under the > AdapterClass column. > > However, when I adaptTo on a Resource instance to one of my classes I > get null. > > Out of curiosity I tried adapting the Resource instance to a Node > instance and adapting that. However, I get compile time error that I'm > unable to resolve the method adaptTo with my class type.
That's expected , Nodes are not adaptable. > > I don't get this compile error with Resource or ResourceResolver, but > perhaps that's being resolved by something like the AdapterManager… I'm > really not sure. > > But one thing I'm pretty sure is that no code is ever called in my > AdapterFactory. I'm not sure when the getAdapter method is called > normally but when I put a breakpoint in the method during a bundle > install or when I try to do the apaption my breakpoint is never hit… > > Any ideas? Am I missing a step? Can you show us the code? Robert > > Rob
