mburbidg
Jun 13th, 2008, 01:10 PM
I'm a novice at OSGi, so perhaps this should have been obvious. The thing that absolutely drove me nuts trying to get a basic OSGi/Spring-DM web application up and running was figuring out the bundle dependencies. I would get an ClassDefNotFound exception for foo.Y. I would go get the bundle for foo and install it and still get the exception. The reason is that foo depended on fee and I didn't have fee installed.
Based on a long history of computer science, I was assuming that now that foo.Y was available the exception would change to fee.Z, where fee.Z was the class that foo.Y depended on. But it doesn't. At least in some cases you will continue to get a ClassDefNotFound exception for foo.Y, until all the classes it transitively depends on can be resolved.
I've tried both equinox and Knoplerfish and they both seem to behave the same in this regard.
Two things can really help in resolving these dependencies. The BRIT repository lists the dependencies for each bundle in the repository. Second, if you are working with a bundle not in the repository, you can use the "diag X" command on the equinox command line. This command will list any dependencies for bundle X that are missing. X is the bundle number, which you can look up using the status command.
I'm guessing that the other OSGi frameworks have a similar facility.
Realizing how OSGi works in this regard has really helped! I just wish I'd figured this out 2 weeks ago!
Michael-
Based on a long history of computer science, I was assuming that now that foo.Y was available the exception would change to fee.Z, where fee.Z was the class that foo.Y depended on. But it doesn't. At least in some cases you will continue to get a ClassDefNotFound exception for foo.Y, until all the classes it transitively depends on can be resolved.
I've tried both equinox and Knoplerfish and they both seem to behave the same in this regard.
Two things can really help in resolving these dependencies. The BRIT repository lists the dependencies for each bundle in the repository. Second, if you are working with a bundle not in the repository, you can use the "diag X" command on the equinox command line. This command will list any dependencies for bundle X that are missing. X is the bundle number, which you can look up using the status command.
I'm guessing that the other OSGi frameworks have a similar facility.
Realizing how OSGi works in this regard has really helped! I just wish I'd figured this out 2 weeks ago!
Michael-