You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by goku3989 <ma...@msn.com> on 2016/01/28 06:09:14 UTC
[Karaf 4.0.4] Bundle exception : Unresolved requirement on first
startup
Hello,
I've an application that I've been successfully running under Karaf 3.0.3
for quite some time. I recently tried to migrate to Karaf 4.0.4 but have run
into a bit of an issue.
Specifically, I have a number of non-OSGi JARs that are placed in the deploy
directory. In the past, these JARs would all get wrapped on the fly and the
container would then fully start with all of the bundles in 'Active' state.
However, with 4.0.4, when I run the container for the first time, I often
get a bunch of BundleExceptions complaining about missing requirements and
multiple bundles stay in the 'Installed' state. It seems like it maybe wraps
one bundle and then tries to start it even though its dependencies may not
have gone through the wrapping process yet. If I then shutdown and restart
the container, everything appears to start correctly. So, it *seems* that
the wrap deployer is ultimately doing its thing, but it doesn't try to
restart all the wrapped bundles after the wrapping process is complete (or
something to that effect). Again, this has worked perfectly in Karaf 3.0.3
with this same set of JARs.
An example stacktrace is shown below. I actually get several of these for
various JARs in the deploy directory.
I've seen this behavior with both Karaf 4.0.2 and 4.0.4; I've not tried any
of the other Karaf 4.0.x releases.
Also, I'm currently using the equinox runtime that is available with Karaf
4.0.4, but I see similar behavior with felix as well.
Thanks in advance for any assistance! Please let me know if I can provide
any additional context.
-- snip --
2016-01-27 17:31:26,030 | WARN | i-runtime/deploy | fileinstall
| 8 - org.apache.felix.fileinstall - 3.5.0 | Error while starting bundle:
file:/C:/karaf/osgi-runtime/deploy/jackson-datatype-joda-2.6.2.jar
org.osgi.framework.BundleException: Could not resolve module:
com.fasterxml.jackson.datatype.jackson-datatype-joda [19]
Unresolved requirement: Import-Package: com.fasterxml.jackson.annotation;
version="[2.6.0,3.0.0)"
at
org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[8:org.apache.felix.fileinstall:3.5.0]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[8:org.apache.felix.fileinstall:3.5.0]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[8:org.apache.felix.fileinstall:3.5.0]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[8:org.apache.felix.fileinstall:3.5.0]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[8:org.apache.felix.fileinstall:3.5.0]
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034.html
Sent from the Karaf - User mailing list archive at Nabble.com.
RE: [Karaf 4.0.4] Bundle exception : Unresolved requirement on
first startup
Posted by goku3989 <ma...@msn.com>.
Hi JP,
Indeed, it does seem to be a first time startup issue. Subsequent restarts
seem to work fine with the default fileinstall properties.
-Matt
CLEMENT Jean-Philippe wrote
> Does this problem only occur during the first launch of Karaf? In other
> words after a successful start did you try to launch Karaf with default
> fileinstall properties?
>
> JP
>
> -----Message d'origine-----
> De : goku3989 [mailto:
> mattwharton@
> ]
> Envoyé : vendredi 29 janvier 2016 04:25
> À :
> user@.apache
> Objet : Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on
> first startup
>
> After playing around a bit more, it seems that there may be something
> timing related here. I changed the fileinstall properties to wait 3
> seconds before trying to load any bundles in the deploy directory. Since
> I've done that, I've been able to do numerous successful clean starts (no
> cached bundles).
>
> I wonder if there is some fundamental service/feature that needs a bit
> longer to fully start up before the "hot deploy" wrapping works properly?
>
> Thanks,
>
> -Matt
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045051.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045060.html
Sent from the Karaf - User mailing list archive at Nabble.com.
RE: [Karaf 4.0.4] Bundle exception : Unresolved requirement on
first startup
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Does this problem only occur during the first launch of Karaf? In other words after a successful start did you try to launch Karaf with default fileinstall properties?
JP
-----Message d'origine-----
De : goku3989 [mailto:mattwharton@msn.com]
Envoyé : vendredi 29 janvier 2016 04:25
À : user@karaf.apache.org
Objet : Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on first startup
After playing around a bit more, it seems that there may be something timing related here. I changed the fileinstall properties to wait 3 seconds before trying to load any bundles in the deploy directory. Since I've done that, I've been able to do numerous successful clean starts (no cached bundles).
I wonder if there is some fundamental service/feature that needs a bit longer to fully start up before the "hot deploy" wrapping works properly?
Thanks,
-Matt
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045051.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on
first startup
Posted by goku3989 <ma...@msn.com>.
After playing around a bit more, it seems that there may be something timing
related here. I changed the fileinstall properties to wait 3 seconds before
trying to load any bundles in the deploy directory. Since I've done that,
I've been able to do numerous successful clean starts (no cached bundles).
I wonder if there is some fundamental service/feature that needs a bit
longer to fully start up before the "hot deploy" wrapping works properly?
Thanks,
-Matt
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045051.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on first
startup
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Matt,
Ah ok, I got it. It's probably a race condition, as the wrap deployer
would need some time to wrap on the fly the jar as bundles. However, the
wrap deployer should "lock" the jar to avoid to process it again in
cycle. Let me check if we changed something there.
Regards
JB
On 01/28/2016 07:24 PM, goku3989 wrote:
> Hi JB,
>
> I do have a similar exception about javax.annotation (complaining about
> com.fasterxml.jackson.core.jackson-databind) but that actually gets reported
> after the exception about jackson-datatype-joda-2.6.2.jar that I had listed
> below.
>
> The JARs I need are seemingly all there in the deploy directory, but a bunch
> of them don't have the compliant OSGi manifests. It seems like it's trying
> to load JARs before the dependency JARs have been wrapped. Once the wrap
> deployer does its thing, it seems like everything is able to start, but I
> have to explicitly stop the container and then restart it. With 3.0.3, with
> the exact same JARs in deploy, I didn't need to do the explicit restart.
>
> Thanks for your help,
>
> -Matt
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045050.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on
first startup
Posted by goku3989 <ma...@msn.com>.
Hi JB,
I do have a similar exception about javax.annotation (complaining about
com.fasterxml.jackson.core.jackson-databind) but that actually gets reported
after the exception about jackson-datatype-joda-2.6.2.jar that I had listed
below.
The JARs I need are seemingly all there in the deploy directory, but a bunch
of them don't have the compliant OSGi manifests. It seems like it's trying
to load JARs before the dependency JARs have been wrapped. Once the wrap
deployer does its thing, it seems like everything is able to start, but I
have to explicitly stop the container and then restart it. With 3.0.3, with
the exact same JARs in deploy, I didn't need to do the explicit restart.
Thanks for your help,
-Matt
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034p4045050.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: [Karaf 4.0.4] Bundle exception : Unresolved requirement on first
startup
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
do you really have a bundle providing com.fasterxml.jackson.annotation
package in the expected version range (you can check with package:exports) ?
Don't you have another exception (like missing javax.annotation package) ?
Regards
JB
On 01/28/2016 06:09 AM, goku3989 wrote:
> Hello,
>
> I've an application that I've been successfully running under Karaf 3.0.3
> for quite some time. I recently tried to migrate to Karaf 4.0.4 but have run
> into a bit of an issue.
>
> Specifically, I have a number of non-OSGi JARs that are placed in the deploy
> directory. In the past, these JARs would all get wrapped on the fly and the
> container would then fully start with all of the bundles in 'Active' state.
> However, with 4.0.4, when I run the container for the first time, I often
> get a bunch of BundleExceptions complaining about missing requirements and
> multiple bundles stay in the 'Installed' state. It seems like it maybe wraps
> one bundle and then tries to start it even though its dependencies may not
> have gone through the wrapping process yet. If I then shutdown and restart
> the container, everything appears to start correctly. So, it *seems* that
> the wrap deployer is ultimately doing its thing, but it doesn't try to
> restart all the wrapped bundles after the wrapping process is complete (or
> something to that effect). Again, this has worked perfectly in Karaf 3.0.3
> with this same set of JARs.
>
> An example stacktrace is shown below. I actually get several of these for
> various JARs in the deploy directory.
>
> I've seen this behavior with both Karaf 4.0.2 and 4.0.4; I've not tried any
> of the other Karaf 4.0.x releases.
>
> Also, I'm currently using the equinox runtime that is available with Karaf
> 4.0.4, but I see similar behavior with felix as well.
>
> Thanks in advance for any assistance! Please let me know if I can provide
> any additional context.
>
> -- snip --
>
> 2016-01-27 17:31:26,030 | WARN | i-runtime/deploy | fileinstall
> | 8 - org.apache.felix.fileinstall - 3.5.0 | Error while starting bundle:
> file:/C:/karaf/osgi-runtime/deploy/jackson-datatype-joda-2.6.2.jar
> org.osgi.framework.BundleException: Could not resolve module:
> com.fasterxml.jackson.datatype.jackson-datatype-joda [19]
> Unresolved requirement: Import-Package: com.fasterxml.jackson.annotation;
> version="[2.6.0,3.0.0)"
>
> at
> org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
> at
> org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[8:org.apache.felix.fileinstall:3.5.0]
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[8:org.apache.felix.fileinstall:3.5.0]
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[8:org.apache.felix.fileinstall:3.5.0]
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[8:org.apache.felix.fileinstall:3.5.0]
> at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[8:org.apache.felix.fileinstall:3.5.0]
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-4-Bundle-exception-Unresolved-requirement-on-first-startup-tp4045034.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com