Expand my Community achievements bar.

SOLVED

osgi.wiring.package=com.day.cq.wcm.api

Avatar

Level 2

I get an exception when starting the server on an already installed bundle 

osgi.wiring.package=com.day.cq.wcm.api

It looks like the bundle is started after the com.day.cq.wcm.api bundle is started or initialized. If the instance is started, I can upload my bundle without any problem.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Bert,

with OSGI it is the Import- and Export-Package dependencies that determine the start order, in this way the framework will not start your bundles until it's dependencies are available. However, something seems to be going wrong with your code. Although Karaf related, [1] gives a good overview. 

Please humor me and import into your bundle declaration all the packages that the gemotrixx system has; for a 5.6.1 system I see 5 imports.

Regards,

Opkar

[1] http://stackoverflow.com/questions/11574166/what-is-the-natural-start-order-for-package-dependent-os...

View solution in original post

5 Replies

Avatar

Level 10
Have you included this jar in your maven pom.xml ? Use embed dependency if you haven't

Avatar

Level 10

So to clarify - the bundle works fine when you install it using Felix console? 

Avatar

Level 2

Yes when installing in the console all works fine, no errors. When I restart the instance again, I get this problem, strange thing is, for example the geometrixx core bundle has the same import, but that starts without any problem. I looed into that bundle to see difference but there are none.

Avatar

Level 2

I've now investigated some further, it is the first import that fails, now stripped the bundle to a minimum and then I get 

Unable to resolve 500.0: missing requirement [500.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.sling.api)(version>=2.3.0)(!(version>=3.0.0)))

When I install it is is fine, but restarting gives this error, when I look up the bundle it is all fine, except for not starting

             
Exported Packagescom.adobe.consulting,version=0.0.1
Imported Packagesorg.apache.sling.api,version=[2.3,3) from org.apache.sling.api (66)
Manifest HeadersBnd-LastModified: 1438752725532
Build-Jdk: 1.7.0_67
Built-By: bert.heikamp
Bundle-Description: test
Bundle-ManifestVersion: 2
Bundle-Name: test
Bundle-SymbolicName: efocus.test
Bundle-Version: 0.0.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: com.adobe.consulting; version="0.0.1"; uses:="org.apache.sling.api"
Import-Package: org.apache.sling.api; version="[2.3, 3)"
Manifest-Version: 1.0
Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.7))"
Tool: Bnd-2.4.1.201501161923

Avatar

Correct answer by
Employee

Hi Bert,

with OSGI it is the Import- and Export-Package dependencies that determine the start order, in this way the framework will not start your bundles until it's dependencies are available. However, something seems to be going wrong with your code. Although Karaf related, [1] gives a good overview. 

Please humor me and import into your bundle declaration all the packages that the gemotrixx system has; for a 5.6.1 system I see 5 imports.

Regards,

Opkar

[1] http://stackoverflow.com/questions/11574166/what-is-the-natural-start-order-for-package-dependent-os...