1
votes

I have a Web Application Client Bundle (WAB) with OSGi after a tutorial and I want to use packages from quartz scheduler for a specific task. I'm using also Maven and I put the following dependency:
org.quartz-scheduler quartz 2.2.1 compile org.quartz-scheduler quartz-jobs 2.2.1 compile

I've checked in Maven repository and it seems to be everything ok, the packages/jars from the quartz jar are exported in the MANIFEST.MF. At compilation everything is fine but at the runtime I receive this error:

[#|2013-12-11T18:49:07.590+0100|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=64;_ThreadName=Thread-2;|org.osgi.framework.BundleException: Unresolved constraint in bundle employee.identitymanagement.web_client [516]: Unable to resolve 516.0: missing requirement [516.0] osgi.wiring.package; (&(osgi.wiring.package=org.quartz)(version>=2.2.0)(!(version>=3.0.0))) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826) at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153) at org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456) at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)

And I'm not sure about the problem......If anyone can help me, I can give more details about it. Thanks in advance!

2

2 Answers

0
votes

You need to install a bundle into your runtime that exports the package org.quartz.

0
votes

If you're using a feature.xml file you most likely need to add a <bundle></bundle> to the feature in question. Something similar to (and this assumes you're using apache commons-validator 1.4.1):

<feature name="foo" version="${project.version}-${build.number}">
    <bundle>mvn:org.apache.commons/commons-lang3/${apache.commons.lang.version}</bundle>
    <bundle>mvn:commons-validator/commons-validator/${commons-validator.version}</bundle>
    <bundle>mvn:commons-beanutils/commons-beanutils/1.8.3</bundle>
    <bundle>mvn:commons-digester/commons-digester/1.8.1</bundle>
    <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
    <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
</feature>

Hope this helps.

FWIW, I would strongly discourage you from using the <Export-Package> element in the maven-bundle-plugin because overriding the default value of * for this element and adding your missing package will remove all the other packages added automatically by the * - which is almost assuredly NOT what you want.