renatoathaydes / osgi-run

Osgi-Run - A Gradle plugin to make the development of modular applications using OSGi completely painless
Apache License 2.0
54 stars 13 forks source link

[examples] quartz-sample fails when swithcing to 'org.dm.bundle' plugin #36

Closed paulvi closed 8 years ago

paulvi commented 8 years ago

in quartz-sample-nested-jars example:

https://github.com/paulvi/osgi-run/tree/master/osgi-run-test/quartz-sample-nested-jars

there's error, so resulted bundle is not ACTIVE in felix, and can't be started.

full log

# parseClassFile(): path=org/xml/sax/ErrorHandler.class resource=:file:/C:/Program%20Files/Java/jdk1.8.0_74/jre/lib/rt.j
ar!/org/xml/sax/ErrorHandler.class:
:quartz-sample-nested-jars:createOsgiRuntime
> Building 83% > :quartz-sample-nested-jars:runOsgi

:quartz-sample-nested-jars:runOsgi
org.osgi.framework.BundleException: Unable to resolve com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0): mis
sing requirement [com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.package; (osgi.wiring.packa
ge=commonj.work) Unresolved requirements: [[com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.p
ackage; (osgi.wiring.package=commonj.work)]
ERROR: Bundle com.athaydes.gradle.osgi.quartz-sample-nested-jars [6] Error starting file:/D:/Workspaces/GitHub/osgi-run/
osgi-run-test/quartz-sample-nested-jars/build/osgi/bundle/quartz-sample-nested-jars-1.0.jar (org.osgi.framework.BundleEx
ception: Unable to resolve com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0): missing requirement [com.athay
des.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.package; (osgi.wiring.package=commonj.work) Unresolved
 requirements: [[com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.package; (osgi.wiring.packag
e=commonj.work)])
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)
____________________________
Welcome to Apache Felix Gogo

> Building 83% > :quartz-sample-nested-jars:runOsgilb
g! g! g! START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (5.4.0)|5.4.0
    1|Active     |    1|c3p0 (0.9.1.1)|0.9.1.1
    2|Active     |    1|Apache Felix Gogo Command (0.16.0)|0.16.0
    3|Active     |    1|Apache Felix Gogo Runtime (0.16.2)|0.16.2
    4|Active     |    1|Apache Felix Gogo Shell (0.12.0)|0.12.0
    5|Active     |    1|quartz (2.2.1)|2.2.1
    6|Installed  |    1|com.athaydes.gradle.osgi.quartz-sample-nested-jars (1.0.0)|1.0.0
    7|Active     |    1|slf4j-api (1.6.6)|1.6.6
    8|Resolved   |    1|slf4j-simple (1.6.6)|1.6.6
> Building 83% > :quartz-sample-nested-jars:runOsgistart 6
org.osgi.framework.BundleException: Unable to resolve com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0): mis
sing requirement [com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.package; (osgi.wiring.packa
ge=commonj.work) Unresolved requirements: [[com.athaydes.gradle.osgi.quartz-sample-nested-jars [6](R 6.0)] osgi.wiring.p
ackage; (osgi.wiring.package=commonj.work)]
> Building 83% > :quartz-sample-nested-jars:runOsgi

ref #32 , https://github.com/TomDmitriev/gradle-bundle-plugin/issues/54 @TomDmitriev @rotty3000

My TODO is raise on stackoverflow.com

renatoathaydes commented 8 years ago

@paulvi I don't think this is related to osgi-run in the sense there's nothing I can do to help make this work. osgi-run's only purpose is to create an OSGi runtime with the bundles you have and run it easily... if the bundle is not being created correctly, you need to see what's going on with the bundle creator, in this case the gradle-bundle-plugin, I guess.

Why does the bundle need osgi.wiring.package=commonj.work? Where this comes from? If it were a Gradle dependency of your project, osgi-run would have added it to the runtime... maybe you just need to add a osgiRuntime 'org:commonj.work:version' declaration in the Gradle deps?

paulvi commented 8 years ago

asked on http://stackoverflow.com/questions/36501151/error-when-switching-from-gradle-osgi-plugin-to-org-dm-bundle-plugin

renatoathaydes commented 8 years ago

Please see my answer on Stackoverflow. Closing this as this is not applicable to this plugin.