Hi,

Sorry for slow (and long) reply…

------------------------------------------------- NATIVE
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

*This is what I get if I use “ls”, “list”, “comp” and “ls -c” in native OSGi
container:*

osgi> ls *(SteffeC: Same for “list”, lists the unsatisfied services and is
very useful.)*
All Components:
ID      State                   Component Name                  Located in
bundle
1       Active                  MyComponent1                     a.b.c.d.1
(bid=13)
2       Active                  MyComponent2                     a.b.c.d.2
(bid=17)
…
*8       Unsatisfied        MyComponent3                       a.b.c.d.3
(bid=26)*
…


osgi> comp 8  *(SteffeC: This command gives useful error information about a
specific service.)*
        Component[
        name = MyComponent3
        activate = activate
        deactivate = deactivate
        modified =
        configuration-policy = require
        factory = null
        autoenable = true
        immediate = true
        implementation = MyComponent3
        *state = Unsatisfied*
        properties = {service.pid= MyComponent3,
MyComponent3=localhost:12001}
        serviceFactory = false
        serviceInterface = [MyComponent3]
        references = null
        located in bundle = MyComponent3 [26]
]
Dynamic information :
  The component is satisfied
  All component references are satisfied
  Component configurations :
    Configuration properties:
      objectClass = String[MyComponent3]
      service.pid = MyComponent3
      component.name = MyComponent3
      component.id = 93
    Instances:
  *No instances were created because: Can not activate instance of component
MyComponent3. The activation throws: java.lang.IllegalArgumentException:
Cannot instantiate MailboxType [akka.dispatch.UnboundedMailbox], defined in
[akka.actor.default-mailbox], make sure it has a public constructor with
[akka.actor.ActorSystem.Settings, com.typesafe.config.Config] parameters*


osgi> ls -c 26 *(SteffeC: This command gives useful error information about
all services in a bundle.)*
Components in bundle MyComponent3:
ID      Component details
8       Component[
        name = MyComponent3
        activate = activate
        deactivate = deactivate
        modified =
        configuration-policy = require
        factory = null
        autoenable = true
        immediate = true
        implementation = MyComponent3
        *state = Unsatisfied*
        properties = {service.pid= MyComponent3,
MyComponent3=localhost:12001}
        serviceFactory = false
        serviceInterface = [MyComponent3]
        references = null
        located in bundle = MyComponent3 [26]
]
Dynamic information :
  The component is satisfied
  All component references are satisfied
  Component configurations :
    Configuration properties:
      objectClass = String[MyComponent3]
      service.pid = MyComponent3
      component.name = MyComponent3
      component.id = 93
    Instances:
    *No instances were created because: Can not activate instance of
component MyComponent3. The activation throws:
java.lang.IllegalArgumentException: Cannot instantiate MailboxType
[akka.dispatch.UnboundedMailbox], defined in [akka.actor.default-mailbox],
make sure it has a public constructor with [akka.actor.ActorSystem.Settings,
com.typesafe.config.Config] parameters*


osgi> comp 68 *(SteffeC: This is an example of other useful error
information that the native command gives on a specific service)*
        Component[
        name = MyComponent10
        activate = activate
        deactivate = deactivate
        modified =
        configuration-policy = optional
        factory = null
        autoenable = true
        immediate = true
        implementation = MyComponent10
        *state = Unsatisfied*
        properties = {service.pid= MyComponent10}
        serviceFactory = false
        serviceInterface = [MyComponent10]
        references = {
                Reference[name = MyReference1, interface = MyReference1,
policy = static, cardinality = 1..1, target = null, bind = bind, unbind =
unbind]
                Reference[name = MyReference2, interface = MyReference2,
policy = static, cardinality = 1..1, target = null, bind = bind, unbind =
unbind]
                Reference[name = MyReference3, interface = MyReference3,
policy = static, cardinality = 1..1, target = null, bind = bind, unbind =
unbind]
                Reference[name = MyReference4, interface = MyReference4,
policy = static, cardinality = 1..1, target = null, bind = bind, unbind =
unbind]
                Reference[name = MyReference5, interface = MyReference5,
policy = static, cardinality = 1..1, target = null, bind =
bindEventProvider, unbind = unbindEventProvider]
        }
        located in bundle = MyComponent10 [142]
]
Dynamic information :
  **The component is NOT satisfied
  The following references are not satisfied:
    Reference[name = MyReference2, interface = MyReference2, policy =
static, cardinality = 1..1, target = null, bind = bind, unbind = unbind]
    Reference[name = MyReference5, MyReference5, policy = static,
cardinality = 1..1, target = null, bind = bind, unbind = unbind]*
  Component configurations :
    Configuration properties:
      objectClass = String[MyComponent10]
      service.pid = MyComponent10
      component.name = MyComponent10
      component.id = 63
    Instances:


*It is the bold marked information in “comp” and “ls -c” that is very useful
during development when trying to find out what/why services are not
satisfied…*

------------------------------------------------------- KARAF
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

*This is what I get when using “services:list”, “ls”, “list”, “comp” and “ls
-c” in Karaf 2.3.2:*

karaf> services:list *(SteffeC: This command failed in Karaf container.)*
Command not found: services:list


karaf> ls *(SteffeC: The output from this command is different in Karaf.
Especially it doesn’t display the service “State”.)*
OSGi System Bundle (0) provides:
--------------------------------
org.osgi.service.packageadmin.PackageAdmin
org.osgi.service.permissionadmin.PermissionAdmin,
org.osgi.service.condpermadmin.ConditionalPermissionAdmin
org.osgi.service.startlevel.StartLevel
org.eclipse.osgi.service.debug.DebugOptions
java.lang.ClassLoader
…
org.eclipse.osgi.service.security.TrustEngine
org.eclipse.osgi.signedcontent.SignedContentFactory
org.eclipse.osgi.internal.provisional.verifier.CertificateVerifierFactory
org.osgi.service.framework.CompositeBundleFactory

OPS4J Pax Url - mvn: (1) provides:
----------------------------------
org.osgi.service.cm.ManagedService
org.osgi.service.url.URLStreamHandlerService

OPS4J Pax Url - wrap: (2) provides:
-----------------------------------
…


karaf> list *(SteffeC: The command gives information about the bundles
instead of the services in Karaf container?)*
START LEVEL 100 , List Threshold: 50
   ID   State         Blueprint      Level  Name
…
[  54] [Active     ] [            ] [   80] OPS4J Base - Lang (1.4.0)
[  55] [Active     ] [            ] [   80] OPS4J Base - Monitors (1.4.0)
[  56] [Active     ] [            ] [   80] OPS4J Base - Net (1.4.0)
[  57] [Active     ] [            ] [   80] OPS4J Base - Store (1.4.0)
[  58] [Active     ] [            ] [   80] OPS4J Base - IO (1.4.0)
[  59] [Active     ] [            ] [   80] OPS4J Base - Service Provider
Access (1.4.0)
…

karaf> comp 143  *(SteffeC: This command failed in Karaf container. The
detailed information about a service is very useful during development.)*
Invalid component ID!


karaf> ls -c 45  *(SteffeC: This command failed in Karaf container. The
detailed information about a service is very useful during development.)*
Error executing command osgi:ls undefined option –c


*I was not aware of “src”, so installed that feature but it only covers the
native “ls” output command.*

karaf> features:install scr


karaf> help
COMMANDS
…
        scr:activate                      Activates a Component for the
given name
        scr:deactivate                    Deactivates a Component for the
given name
        scr:details                       Displays a list of available
components  *(SteffeC: Is this slogan wrong? Same as for scr:list.)*
        scr:list                          Displays a list of available
components
…


karaf> scr:list  *(SteffeC: The output from this command gives almost the
same information as “ls” in native container and most important it displays
the service “State”.)*
   ID   State             Component Name
…
[3   ] [ACTIVE          ] MyComponent1
[17  ] [ACTIVE          ] MyComponent2
*[7   ] [UNSATISFIED     ] MyComponent3*
…


karaf> scr:details  MyComponent3 *(SteffeC: The output from this command
doesn’t give any useful information about why the service is unsatisfied?
The “comp” and “ls -c” commands in native container gives useful information
about this.)*
Component Details
  Name                : MyComponent3
  State               : UNSATISFIED
  Properties          :
    service.pid= MyComponent3
    component.name= MyComponent3
    component.id=7
References

*I still don’t know how to display the detailed service information in Karaf
that the native “comp” and “ls -c” command generates.*

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When using the available Karaf commands, I can’t see the important error
information that is displayed in native OSGi container when using  “comp”
and “ls -c” commands.

Am I using the commands above incorrectly or are there other commands I
should use instead?

Is it possible to use "webconsole-scr" to get the error information that
native “comp” and “ls -c” displays (have not tried it yet)?

If the service information can’t be displayed with the existing commands in
Karaf, is it possible to “wish” for such commands? Where do I do that? 

Regards
StefanC




--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-see-status-of-services-and-why-they-are-NOT-satisfied-in-Karaf-container-tp4032359p4032493.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to