method buildKeyspace in class Builder cannot be applied to given types #247

paulinthought opened this Issue Mar 24, 2013 · 4 comments

2 participants


I have a connection string which is throwing the following error:
method buildKeyspace in class Builder cannot be applied to given types;
required: AstyanaxTypeFactory
found: ThriftFamilyFactory
reason: inferred type does not conform to declared bound(s)
inferred: Client
bound(s): Object
where T is a type-variable:

T extends Object declared in method buildKeyspace(AstyanaxTypeFactory)

The connection string is below. I can't figure out why the ThriftFamilyFactory.getInstance() method is causing this. Any help appreciated. I'm using astyanax-thrift, astyanax-cassandra and astyanax-core all versions 1.56.29. I've also tried updating to astyanax-thrift 1.56.31 but the problem persists.

CassDAO.context = new AstyanaxContext.Builder()
.withAstyanaxConfiguration( new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
new ConnectionPoolConfigurationImpl("MyConnectionPool").setPort(9160)
new CountingConnectionPoolMonitor()

.buildKeyspace( ThriftFamilyFactory.getInstance() );

Netflix, Inc. member

Ive never seeing this error. Are you trying this with java or another language?


Using Java. It's strange because I 1st loaded the astyanax 1.5.26 before I realised I need to install thrift, core and cassandra libs separately to use the newer versions. I installed those 3 and then removed the astyanax 1.5.26. That's when I started getting the error. I've just reinstalled 1.5.26 along with the 3 other libs and the error disappears!
I'm new to netbeans and maven so maybe I'm not loading my libraries in an optimal way??

Netflix, Inc. member

I suspect that it disappeared because it's actually only accessing the old 1.56.26 jar. Splitting the project did cause a bit of a headache because astyanax.jar is now obsolete and can conflict with the new split jars. We've actually seen situations where code was being compiled against astyanax.jar but only the split jars were being deployed. The best thing to do is try to determine if anything is pulling in the older unsplit 1.56.26 jars and make sure those are excluded from your build by either updating any transitive dependencies or specifically excluding astyanax.jar and only including the new split jars.


Thanks for your help. I figured it out. I was missing the libraries org.apache.cassandra.thrift and org.apache.cassandra. Once I loaded them I was able to query successfully without the astyanax1.5.26 library.

@elandau elandau closed this Mar 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment