Ok,

After another 10 hours of frustration, I finally solved the issue. By
debugging the Aries Whiteboard activator, it is looking for a service
matching;
"(&(objectClass=org.osgi.service.http.runtime.HttpServiceRuntime)(osgi.http.endpoint=*))".
Happens that I am having resolver chain issues with this specifically (and
my colleague is not, which I can't explain).

This was colliding between org.ops4j.pax.web.pax-web-api (which I see as
being used by the working copy) and in my case "org.eclipse.osgi.services"
and "org.osgi.service.http.whiteboard 1.1" as well. I got rid of
"org.eclipse.osgi.services"and instead locally use the org.osgi.* bundles
and for the http.whiteboard, I lowered my import package to 1.0 to match
paxweb export package version and the issue is gone. I honestly think that
"org.eclipse.osgi.services" is evil.

Cheers,
Alain

On Sat, Dec 1, 2018 at 5:43 PM Alain Picard <pic...@castortech.com> wrote:

> Banging my head trying to figure out why my jaxrs is not starting properly.
>
> One of my colleague is running what should be the same environment and it
> works in his, but he has seen issues at time.
>
> In my log I see:
> 17:28:09.870 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] DEBUG o.o.p.w.e.w.i.Activator - Pax
> Web Whiteboard Extender started
> 17:28:10.863 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] DEBUG
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Starting the whiteboard factory
> 17:28:10.901 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] INFO
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Registered ClientBuilder
> 17:28:10.905 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] INFO
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Registered SseEventSourceFactory
> 17:28:10.914 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] DEBUG
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - adding new whiteboard
> configuration: {service.pid=org.apache.aries.jax.rs.whiteboard.default}
> 17:28:10.948 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] DEBUG
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Whiteboard factory started
> 17:28:11.021 [Start Level: Equinox Container:
> 8adb54b2-c97b-4651-9844-16e93c4d8f80] DEBUG o.o.p.w.s.i.Activator -
> Starting Pax Web
>
> And there is no reference to AriesJaxrsServiceRuntim.
>
> Looking for JaxrsServiceRuntime returns that it is registered:
> se org.osgi.service.jaxrs.runtime.JaxrsServiceRuntime
> {org.osgi.service.jaxrs.runtime.JaxrsServiceRuntime}={service.id=55,
> service.bundleid=11, service.scope=singleton, service.ranking=-2147483648,
> service.pid=org.apache.aries.jax.rs.whiteboard.default}
>   "Registered by bundle:" org.apache.aries.jax.rs.whiteboard_1.0.0 [11]
>   "No bundles using service."
>
> But the runtime DTO returns:
> {"serviceDTO":null, "defaultApplication":null, "applicationDTOs":[],
> "failedResourceDTOs":[], "failedExtensionDTOs":[],
> "failedApplicationDTOs":[]}
>
>
> The log from my colleague has a lot more starting with
> AriesJaxrsServiceRuntim:
> 15:42:52.941 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Starting the whiteboard factory
> 15:42:53.020 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] INFO
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Registered ClientBuilder
> 15:42:53.023 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] INFO
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - Registered SseEventSourceFactory
> 15:42:53.034 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - adding new whiteboard
> configuration: {service.pid=org.apache.aries.jax.rs.whiteboard.default}
> 15:42:53.092 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] INFO
> o.a.a.j.r.w.a.CxfJaxrsBundleActivator - created whiteboard from
> configuration: {service.pid=org.apache.aries.jax.rs.whiteboard.default}
> 15:42:53.142 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG
> o.a.a.j.r.w.i.AriesJaxrsServiceRuntime - Registered service
> CachingServiceReference {
> cachedProperties={osgi.jaxrs.name=.default,
> osgi.jaxrs.whiteboard.target=(service.pid=org.apache.aries.jax.rs.whiteboard.default)}
> serviceReference={javax.ws.rs.core.Application}={osgi.jaxrs.application.base=/,
> service.id=79, service.bundleid=152, service.scope=singleton,
> service.ranking=-2147483648, osgi.jaxrs.name=.default,
> osgi.jaxrs.whiteboard.target=(service.pid=org.apache.aries.jax.rs.whiteboard.default),
> service.pid=org.apache.aries.jax.rs.whiteboard.default}
> } for name .default
> 15:42:53.159 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG o.a.a.j.r.w.i.Whiteboard -
> Obtained instance from CachingServiceReference {
> cachedProperties={osgi.jaxrs.application.select=null (cached),
> osgi.jaxrs.application.base=/, osgi.jaxrs.name=.default,
> osgi.jaxrs.extension.select=null (cached),
> osgi.http.whiteboard.context.select=null (cached),
> osgi.jaxrs.whiteboard.target=(service.pid=org.apache.aries.jax.rs.whiteboard.default)}
> serviceReference={javax.ws.rs.core.Application}={osgi.jaxrs.application.base=/,
> service.id=79, service.bundleid=152, service.scope=singleton,
> service.ranking=-2147483648, osgi.jaxrs.name=.default,
> osgi.jaxrs.whiteboard.target=(service.pid=org.apache.aries.jax.rs.whiteboard.default),
> service.pid=org.apache.aries.jax.rs.whiteboard.default}
> }
> 15:42:53.182 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG o.a.a.j.r.w.i.Whiteboard -
> Creating CXF Bus with extensions {} and properties
> {service.pid=org.apache.aries.jax.rs.whiteboard.default}
> 15:42:53.275 [Start Level: Equinox Container:
> cfe72d7c-4e6a-4892-94ae-9333da37a0ba] DEBUG o.a.a.j.r.w.i.Whiteboard -
> Created CXF Bus with extensions {} and properties
> {service.pid=org.apache.aries.jax.rs.whiteboard.default}
>
> Aries referenced bundles
>     11|Active     |    4|Apache Aries JAX-RS Whiteboard (1.0.0)
>     65|Active     |    4|Apache Aries JAX-RS Specification API (1.0.0)
>    103|Active     |    4|Apache Aries Quiesce API (1.0.0)
>    145|Active     |    4|Apache Aries SPI Fly Dynamic Weaving Bundle
> (1.0.12)
>    149|Active     |    4|Apache Aries Blueprint Core (1.9.0)
>    183|Active     |    4|Apache Aries Proxy API (1.1.0)
>    228|Active     |    4|org.apache.aries.component-dsl.component-dsl
> (1.2.0)
>    288|Active     |    4|Apache Aries Blueprint API (1.0.1)
>    343|Active     |    4|Apache Aries Util (1.0.0)
>
> Any ideas?
>
> Thanks
> Alain
>
>
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to