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

Closed
paulinthought opened this Issue Mar 24, 2013 · 4 comments

2 participants

@paulinthought

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()
.forCluster(clusterName).forKeyspace(keyspaceName)
.withAstyanaxConfiguration( new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
.setCqlVersion("3.0.0").setTargetCassandraVersion("1.2")
)
.withConnectionPoolConfiguration(
new ConnectionPoolConfigurationImpl("MyConnectionPool").setPort(9160)
.setMaxConnsPerHost(1).setSeeds("127.0.0.1:9160")
).withConnectionPoolMonitor(
new CountingConnectionPoolMonitor()
)

.buildKeyspace( ThriftFamilyFactory.getInstance() );

@elandau
Netflix, Inc. member

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

@paulinthought

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??

@elandau
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.

@paulinthought

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