As you noticed, scr 1.6.0 use the old felix shell which is different from gogo, so that won't work unless there's a bridge somewhere. For scr trunk, not sure why it doesn't work. Can you first check if the command is actually registered in the registry using the osgi:ls karaf command ? If the command is registered but isn't available, that's a bug in Karaf console. If the command isn't registered, a suspect an exception to be thrown in the ScrCommand#register() method.
On Sat, Mar 19, 2011 at 14:56, Christoper Blunck <ch...@thebluncks.com> wrote: > Hmmm... I don't believe I'm trying to use a karaf feature on top of a gogo > command. > I'm just trying to run the scr:list command without using tab completion or > anything. > Steps to reproduce: > 1.) Download and untar: > http://www.apache.org/dyn/closer.cgi/karaf/2.2.0/apache-karaf-2.2.0.tar.gz > 2.) Start up karaf bin running "cd bin; ./karaf" > 3.) Download into the deploy directory: > http://www.gossipcheck.com/mirrors/apache//felix/org.apache.felix.scr-1.6.0.jar > 4.) type "scr:list" or "scr list" at the prompt. You'll get command not > found. > A couple of things I've noticed... > Here's the source code for the bundle activator for SCR in version 1.6.0: > http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.scr-1.6.0/src/main/java/org/apache/felix/scr/impl/Activator.java > Note that in the start() method there's a try-catch around the part where > the ScrCommand is registered. I added a debug statement to the catch > section and found out that there was a NoClassDefFoundError > on org.apache.felix.shell.Command when the code was trying to register the > ScrCommand. I downloaded org.apache.felix.shll.command 1.4.2 and put it my > deploy directory. That made the NoClassDefFoundError go away but it still > did not make the "scr list" command work. I still got a "command not > found". > Also ... It appears the trunk of SCR has been updated to work with gogo: > http://svn.apache.org/repos/asf/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java > The start() method looks different and the comment suggests it now works > with gogo. > I pulled the trunk and compiled it. I then tried to run karaf with > org.apache.felix.scr-1.6.1-SNAPSHOT. DS started but I still didn't have my > "scr list" command. > Any ideas? > > -c > > On Sat, Mar 19, 2011 at 3:59 AM, Guillaume Nodet <gno...@gmail.com> wrote: >> >> Let's be clear about that. There's no reason why the scr or any gogo >> commands would not work in karaf. >> What does not work is karaf features on top of gogo such as completion >> (both command and parameter). >> If that's not the case, this should clearly be fixed asap. >> >> On Sat, Mar 19, 2011 at 02:33, Christoper Blunck <ch...@thebluncks.com> >> wrote: >> > Hello all, >> > Over in this thread the gogo'ness of SCR is discussed: >> > >> > http://karaf.922171.n3.nabble.com/getting-felix-scr-commands-to-show-up-in-karaf-td2257486.html >> > I'm stuck in the same problem where my SCR bundle loads and all my >> > services >> > are properly satisfied and injected but the scr command itself is not >> > available. >> > Guillame you remarked: >> >> Actually, I've just made some tests and the commands are functional >> >> even >> >> if they don't appear in the <tab> completion >> > I was hoping you could elaborate a little more about this. Are you >> > saying >> > that you were able to get to the scr command in the karaf> prompt? Or >> > were >> > you simply remarking that scr worked wrt injection and that the commands >> > just weren't functional? >> > I recognize that this ticket is still out there: >> > https://issues.apache.org/jira/browse/KARAF-397 >> > And I see the priority is MAJOR. Question to the devs: is this >> > something >> > you expect will be fixed soon? >> > I want to go to Karaf 2.2.0 but the lack of a scr command is going to >> > give >> > my developers a lot of heartache.... >> > >> > Thanks for your time, >> > >> > -c >> > >> > -- >> > Christopher Blunck >> > ch...@thebluncks.com >> > >> > >> >> >> >> -- >> Cheers, >> Guillaume Nodet >> ------------------------ >> Blog: http://gnodet.blogspot.com/ >> ------------------------ >> Open Source SOA >> http://fusesource.com > > > > -- > Christopher Blunck > ch...@thebluncks.com > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com