missing OSGi dependency causes failure
Opened this issue · 1 comments
When using the Hector bundle in an OSGi environment (i.e. in Geronimo), it will fail to work (throwing a ClassNotFoundException) if the cassandra-thrift (org.apache.cassandra.thrift) package bundle happens to be loaded after it, or is unavailable altogether.
This is because the Hector bundle manifest defines org.apache.cassandra.thrift (and every other package, for that matter) as optional, meaning the container need only try to load the dependency once during the bundle activation, and if it cannot find it at that point in time, it will never see it again, even though the Hector bundle itself will resolve with no error, and the cassandra thrift bundle may be activated right after it. Then when Hector is actually used, it will fail.
In order to fix this, I edited the Hector jar's manifest, removing 'resolution:=optional' from the org.apache.cassandra.thrift definition in the Import-Packages line. It would be great if this can be fixed at the source.
If you want to submit a pull request for this, I'll certainly take it.