2 Replies Latest reply on May 22, 2009 1:21 PM by Peter Chandler

    OSGi configurable properties and ServiceMix Bundles

    Peter Chandler Master

      In Eclipse (Equinox):

      I can "Create a configuration to launch the OSGi framework" -> "Run Configuration" -> "VM arguments:" and set parameters like:

      -Dorg.osgi.service.http.port=6532  (what port the start the OSGi HTTP Service on)

       

      "OSGi configurable properties:

      org.osgi.service.http.port - specifies the port number to use for the http serving. The default value for this property is 80 (which requires root permission), as per the OSGi specification."

       

      Question: How do I externally set "standard OSGi configurable properties" in ServiceMix?

        • 1. Re: OSGi configurable properties and ServiceMix Bundles
          Stan Lewis Novice

          You can set this in etc/config.properties.

          • 2. Re: OSGi configurable properties and ServiceMix Bundles
            Peter Chandler Master

            I set the follow in config.properties:

            #

            1. OSGi Configurable and Service Compendium Properties

            #

            1. org.osgi.service.*

            org.osgi.service.http.port=1234

             

            This set the BundleContext properties which is great.

             

            Side effects are:

            1, the follow bundlles will not start:

            OPS4J Pax Web - Web Container (0.4.1)

            OPS4J Pax Web Extender - Whiteboard (0.3.0)

            ERROR: Error starting mvn:org.ops4j.pax.web/pax-web-bundle/0.4.1 (org.osgi.framework.BundleException: Activator start error.)

            java.lang.NullPointerException

                    at org.ops4j.pax.web.service.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:272)

                    at org.ops4j.pax.web.service.internal.ServerControllerImpl.start(ServerControllerImpl.java:54)

                    at org.ops4j.pax.web.service.internal.ServerControllerImpl$Unconfigured.configure(ServerControllerImpl.java:377)

                    at org.ops4j.pax.web.service.internal.ServerControllerImpl.configure(ServerControllerImpl.java:71)

                    at org.ops4j.pax.web.service.internal.Activator$2.updated(Activator.java:148)

                    at org.ops4j.pax.web.service.internal.Activator.createManagedService(Activator.java:171)

                    at org.ops4j.pax.web.service.internal.Activator.start(Activator.java:65)

                    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:591)

                    at org.apache.felix.framework.Felix._startBundle(Felix.java:1607)

                    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)

                    at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1135)

                    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)

             

            2. My HTTP service bundle starts but there is no TCP/IP process listening on org.osgi.service.http.port?

             

            Follow-up questions.

            1. How do I turn-off (not start) all other HTTP Services (bundles)?

            2. What are the minimum bundle I need to start? i.e., OSGi Framework and  Compendium Services.

            3. Do I need to start the HTTP implementation bundle (org.mortbay.jetty)? If so how?

            4. How do I debug inside OSGi HTTP Service? Is there a special log level I can set? Change a log4j.property file?

             

            Thanks,

             

            Peter.