3 Replies Latest reply on May 28, 2009 5:00 PM by pchandler

    etc/config.properties and org.osgi.service.http.port and org.ops4j.pax.web.

    pchandler

      I an trying to use the native org.osgi.service.http (Compendium Service). I have some code that runs fine in Equinox but fails in Servicemix.

       

      First, I change the http port in config.properties file I set org.osgi.service.http.port=1234

       

      Side effects are:

      1, the follow bundlles will not start:

      169 Resolved 50 OPS4J Pax Web - Web Container (0.4.1)

      170 Resolved 50 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. Can org.osgi.service.http and org.ops4j.pax.web.service coexist?

      2. What are the minimum bundle I need to start for only the OSGi Framework and Compendium Services.

      3. Do I need to start the HTTP implementation bundle (org.mortbay.jetty)? If so how? How does org.osgi.service.http get bound to an implementation in ServiceMix?

      4. I do not get any error(s) on httpService.registerServlet(). How do I debug inside OSGi HTTP Service? Is there a special log level I can set? Change a log4j.property file?

      5. Do you have any org.osgi.service.http.HttpService & ServiceMix example code?

       

      Thanks,

       

      Peter.

       

      Edited by: pchandler on May 26, 2009 8:12 PM

        • 1. Re: etc/config.properties and org.osgi.service.http.port and org.ops4j.pax.web.
          gertv

          Peter,

           

          Pax Web is an implementation of the OSGi Compendium HTTP Service.  So once you install the pax-web bundles, you will have the org.osgi.service.http services running as well.  All the standard configuration options are named org.osgi.service.http.* and Pax Web provides a few extensions that use the pax web naming.

           

          The minimal set of bundles can be installed through the web-core feature.  It is the jetty bundle, the Pax Web JSP support and Web Container bundle.  I've given things a little spin on my local machine and I can get this running with the port set to 1234 as you are doing.  Do you have any idea how to reproduce the issue?  Could you try with a clean installation (remove the data directory contents) and install the web-core feature and paste the log contents -- it should show the state transitioning as the web container starts (log/d).

           

          Regards,

           

          Gert

          • 2. Re: etc/config.properties and org.osgi.service.http.port and org.ops4j.pax.web.
            pchandler

            Gert,

             

            Here is what I tried.

            1. I cleaned my installation.

            2. re-started ServiceMix (note: org.osgi.service.http.port=1234)

            3. I then try to install the "web" feature.

             

            Console:

            servicemix features> install web
                  ERROR BundleException: Activator start error.

            Log File:

            18:42:21,209 | INFO  | Thread-12        | SpringCommandExecutor$1          | mo.gshell.DefaultCommandExecutor   90 | Executing (String): install web

            18:42:21,210 | INFO  | Thread-79        | features:install                 | shell.support.OsgiCommandSupport  113 | Executing w/args: web

            18:42:22,787 | INFO  | lixDispatchQueue | bundle                           | ?                                   ? | BundleEvent INSTALLED

            18:42:22,795 | INFO  | lixDispatchQueue | bundle                           | ?                                   ? | BundleEvent RESOLVED

            18:42:22,797 | INFO  | Thread-79        | Activator                        | x.web.service.internal.Activator   63 | Starting pax http service

            18:42:22,802 | INFO  | Thread-79        | bundle                           | ?                                   ? | ServiceEvent REGISTERED

            18:42:22,823 | WARN  | Thread-79        | ConfigurationImpl                | rvice.internal.ConfigurationImpl   77 | Reading configuration property org.osgi.service.http.port has failed

            18:42:22,823 | WARN  | Thread-79        | ConfigurationImpl                | rvice.internal.ConfigurationImpl  259 | Reading configuration property org.ops4j.pax.web.session.timeout has failed

            18:42:22,823 | INFO  | Thread-79        | ServerControllerImpl             | ce.internal.ServerControllerImpl   65 | configuring server: ServerControllerImpl{state=UNCONFIGURED} -> ConfigurationImpl{http enabled=true,http port=null,http secure enabled=false,http secure port=8443,ssl keystore=/ll/pchandler/.keystore,session timeout=null}

            18:42:22,824 | INFO  | Thread-79        | ServerControllerImpl             | ce.internal.ServerControllerImpl   53 | starting server: ServerControllerImpl{state=STOPPED}

            18:42:22,826 | WARN  | Thread-79        | ConfigurationImpl                | rvice.internal.ConfigurationImpl   77 | Reading configuration property org.osgi.service.http.port has failed

            18:42:22,826 | INFO  | Thread-79        | bundle                           | ?                                   ? | ServiceEvent UNREGISTERING

            18:42:22,827 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl   98 | Reading configuration property org.osgi.service.http.enabled has failed

            18:42:22,827 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl   77 | Reading configuration property org.osgi.service.http.port has failed

            18:42:22,827 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl  142 | Reading configuration property org.osgi.service.http.secure.enabled has failed

            18:42:22,827 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl  119 | Reading configuration property org.osgi.service.http.port.secure has failed

            18:42:22,827 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl  163 | Reading configuration property org.ops4j.pax.web.ssl.keystore has failed

            18:42:22,828 | WARN  | guration Updater | ConfigurationImpl                | rvice.internal.ConfigurationImpl  259 | Reading configuration property org.ops4j.pax.web.session.timeout has failed

            18:42:22,828 | INFO  | guration Updater | ServerControllerImpl             | ce.internal.ServerControllerImpl   65 | configuring server: ServerControllerImpl{state=STOPPED} -> ConfigurationImpl{http enabled=null,http port=null,http secure enabled=null,http secure port=null,ssl keystore=null,session timeout=null}

            • 3. Re: etc/config.properties and org.osgi.service.http.port and org.ops4j.pax.web.
              pchandler

              I am all set. I move to FUSE 4.1 and this does not seem to be an issue.

               

              Thanks.

               

              Peter.