Hi, I'm trying to use Eclipse with Hector (latest version) to write a new row to Cassandra 0.7RC4. However, I keep getting a Java error. Any
Here is the .java file: - - - - - - import me.prettyprint.cassandra.serializers.StringSerializer; import me.prettyprint.cassandra.service.CassandraHostConfigurator; import me.prettyprint.hector.api.Cluster; import me.prettyprint.hector.api.Keyspace; import me.prettyprint.hector.api.factory.HFactory; import me.prettyprint.hector.api.mutation.Mutator; class HelloWorldApp { private static StringSerializer stringSerializer = StringSerializer.get(); public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. Cluster cluster = HFactory.getOrCreateCluster("Test Cluster", new CassandraHostConfigurator("170.252.179.233:9160")); Keyspace keyspace = HFactory.createKeyspace("SameerKey", cluster); Mutator<String> mutator = HFactory.createMutator(keyspace, stringSerializer); mutator.insert("cat", "Pets", HFactory.createStringColumn("says", "meow")); } } - - - - - - - - Error: Hello World! log4j:WARN No appenders could be found for logger (me.prettyprint.cassandra.connection.CassandraHostRetryService). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" java.lang.Error: Unresolved compilation problems: The import org.apache.commons.pool cannot be resolved GenericObjectPool cannot be resolved to a variable GenericObjectPool cannot be resolved to a variable GenericObjectPool cannot be resolved to a variable at me.prettyprint.cassandra.service.CassandraHost.<init>(CassandraHost.java:9) at me.prettyprint.cassandra.service.CassandraHostConfigurator.buildCassandraHosts(CassandraHostConfigurator.java:53) at me.prettyprint.cassandra.connection.HConnectionManager.<init>(HConnectionManager.java:60) at me.prettyprint.cassandra.service.AbstractCluster.<init>(AbstractCluster.java:62) at me.prettyprint.cassandra.service.AbstractCluster.<init>(AbstractCluster.java:58) at me.prettyprint.cassandra.service.ThriftCluster.<init>(ThriftCluster.java:17) at me.prettyprint.hector.api.factory.HFactory.createCluster(HFactory.java:107) at me.prettyprint.hector.api.factory.HFactory.getOrCreateCluster(HFactory.java:99) at HelloWorldApp.main(test.java:13) - - - - - - By the way, the Hector PDF said to add the google-collections library as a runtime dependency, but I couldn't find v1.0 of this b/c it's been replaced by Guava. I added Guava r07 to the build path. Also, instead of slf4j-api & slf4j-log4j 1.5.8, I'm using v1.6.1 (not sure if this matters). Any ideas?