1 Reply Latest reply on Jul 14, 2013 11:46 PM by aditya p

    OSGI Bundle will not start

    CQDarren

      Hi Everyone,

       

      I hope someone can help as my OSGI bundle will not and im not sure what is wrong.

       

      I am importing a package using maven into CQ however my bundle does not start.  The OSGi bundle in felix is showing the following stack trace:

       

      Imported Packagescom.day.cq.commons from com.day.cq.cq-commons (178)

      com.siteworx.cq5.ooyala.client from com.siteworx.cq5.ooyala.core (301)

      com.siteworx.cq5.ooyala.client.request from com.siteworx.cq5.ooyala.core (301)

      com.siteworx.cq5.ooyala.service from com.siteworx.cq5.ooyala.core (301)

      javax.activation from com.day.commons.osgi.wrapper.mail (101)

      javax.imageio from org.apache.felix.framework (0)

      javax.imageio.spi from org.apache.felix.framework (0)

      javax.imageio.stream from org.apache.felix.framework (0)

      javax.jcr,version=2.0 from org.apache.sling.jcr.jcr-wrapper (71)

      javax.mail from com.day.commons.osgi.wrapper.mail (101)

      javax.mail.internet from com.day.commons.osgi.wrapper.mail (101)

      javax.mail.util from com.day.commons.osgi.wrapper.mail (101)

      javax.net.ssl from org.apache.felix.framework (0)

      javax.servlet from cqse-httpservice (22)

      javax.xml.bind from org.apache.felix.framework (0)

      javax.xml.bind.annotation from org.apache.felix.framework (0)

      javax.xml.parsers from org.apache.felix.framework (0)

      javax.xml.stream from org.apache.felix.framework (0)

      javax.xml.transform from org.apache.felix.framework (0)

      javax.xml.transform.dom from org.apache.felix.framework (0)

      javax.xml.transform.sax from org.apache.felix.framework (0)

      javax.xml.transform.stream from org.apache.felix.framework (0)

      javax.xml.validation from org.apache.felix.framework (0)

      org.apache.commons.httpclient from com.day.commons.osgi.wrapper.commons-httpclient (100)

      org.apache.commons.httpclient.methods from com.day.commons.osgi.wrapper.commons-httpclient (100)

      org.apache.commons.httpclient.params from com.day.commons.osgi.wrapper.commons-httpclient (100)

      org.apache.sling.api,version=2.1 from org.apache.sling.api (115)

      org.apache.sling.api.resource,version=2.1 from org.apache.sling.api (115)

      org.apache.sling.api.servlets,version=2.1 from org.apache.sling.api (115)

      org.apache.sling.commons.json,version=2.0 from org.apache.sling.commons.json (122)

      org.joda.convert -- Cannot be resolved

      org.osgi.framework,version=1.5 from org.apache.felix.framework (0)

      org.osgi.service.component,version=1.1 from org.apache.felix.scr (44)

      org.osgi.service.event,version=1.2 from org.apache.felix.eventadmin (40)

      org.slf4j,version=1.6 from slf4j.api (12)

      org.w3c.dom from org.apache.felix.framework (0)

      org.xml.sax from org.apache.felix.framework (0)

      org.xml.sax.helpers from org.apache.felix.framework (0)

       

      When I try to start the bundle I see the followingerror in the error.log

       

      12.07.2013 17:25:46.105 *ERROR* [0:0:0:0:0:0:0:1 [1373646346099] POST /system/console/bundles/301 HTTP/1.1] cqse-httpservice %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unresolved constraint in bundle com.siteworx.cq5.ooyala.core [301]: Unable to resolve 301.0: missing requirement [301.0] osgi.wiring.package; (osgi.wiring.package=org.joda.convert)) org.osgi.framework.BundleException: Unresolved constraint in bundle com.siteworx.cq5.ooyala.core [301]: Unable to resolve 301.0: missing requirement [301.0] osgi.wiring.package; (osgi.wiring.package=org.joda.convert)

          at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3896)

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

          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:947)

          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:934)

          at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:339)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

          at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:493)

          at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:418)

          at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:9 6)

          at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)

          at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java: 42)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:49)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:127)

          at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

          at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)

          at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

          at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:55)

          at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

          at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:259)

          at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

          at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75 )

          at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

          at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

          at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

          at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

          at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java: 48)

          at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)

          at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

          at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.ja va:250)

          at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:321)

          at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:340)

          at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:383)

          at com.day.j2ee.servletengine.ServletHandlerImpl.process(ServletHandlerImpl.java:360)

          at com.day.j2ee.servletengine.HttpListener$Worker.run(HttpListener.java:644)

          at java.lang.Thread.run(Unknown Source)

       

      So from what I can gather there is a missing dependacy of joda.convert.  I checked the pom file and I have

       

      <dependency>

           <groupId>com.day.commons.osgi.wrapper</groupId>

            <artifactId>com.day.commons.osgi.wrapper.joda-time</artifactId>

            <version>1.6-0002</version>

      <scope>provided</scope>

      </dependency>

       

      I presume this is the dependancy that has the joda stuff required.

       

      Can anyone herlp me trouble shoot this please?  Im new to OSGI and really would like to understand what is going on here.

       

      Thanks

        • 1. Re: OSGI Bundle will not start
          aditya p

          CQDarren,

           

          The problem may be because you are using joda-time instead of joda-convert.

           

          Try using this dependency

           

          <dependency>

               <groupId>org.joda</groupId>

               <artifactId>joda-convert</artifactId>

               <version>1.1</version>

          </dependency>

           

          Thanks,

          Aditya