cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McNelis <dmcne...@agentisenergy.com>
Subject Re: JDBC Driver issue in 0.8beta1
Date Wed, 27 Apr 2011 21:36:22 GMT
That was my issue.  As suspected, falls into the "I must be doing something
dumb" category.  Thank you, Jonathon.

On Wed, Apr 27, 2011 at 4:32 PM, Jonathan Ellis <jbellis@gmail.com> wrote:

> That looks to me like it's using the thrift definitions from the 0.7
> jar, rather than the 0.8.  Are you sure the old Cassandra jar is no
> longer on your classpath?
>
> On Wed, Apr 27, 2011 at 4:29 PM, David McNelis
> <dmcnelis@agentisenergy.com> wrote:
> > Attached:
> > 21 [main] INFO org.apache.cassandra.cql.jdbc.Connection - Connected to
> > localhost:9160
> > Exception in thread "main"
> > org.apache.cassandra.cql.jdbc.DriverResolverException: Required field
> > 'replication_factor' was not found in serialized data! Struct:
> > KsDef(name:system,
> > strategy_class:org.apache.cassandra.locator.LocalStrategy,
> > strategy_options:{replication_factor=1}, replication_factor:0,
> > cf_defs:[CfDef(keyspace:system, name:NodeIdInfo, column_type:Standard,
> > comparator_type:org.apache.cassandra.db.marshal.TimeUUIDType,
> comment:nodeId
> > and their metadata, row_cache_size:0.0, key_cache_size:0.01,
> > read_repair_chance:0.0, column_metadata:[], gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:6,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:8,
> > memtable_operations_in_millions:0.0375), CfDef(keyspace:system,
> > name:IndexInfo, column_type:Standard,
> > comparator_type:org.apache.cassandra.db.marshal.UTF8Type, comment:indexes
> > that have been completed, row_cache_size:0.0, key_cache_size:0.01,
> > read_repair_chance:0.0, column_metadata:[], gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:5,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:8,
> > memtable_operations_in_millions:0.0375), CfDef(keyspace:system,
> name:Schema,
> > column_type:Standard,
> > comparator_type:org.apache.cassandra.db.marshal.UTF8Type, comment:current
> > state of the schema, row_cache_size:0.0, key_cache_size:0.01,
> > read_repair_chance:0.0, column_metadata:[], gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:3,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:8,
> > memtable_operations_in_millions:0.0375), CfDef(keyspace:system,
> > name:Migrations, column_type:Standard,
> > comparator_type:org.apache.cassandra.db.marshal.TimeUUIDType,
> > comment:individual schema mutations, row_cache_size:0.0,
> > key_cache_size:0.01, read_repair_chance:0.0, column_metadata:[],
> > gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:2,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:8,
> > memtable_operations_in_millions:0.0375), CfDef(keyspace:system,
> > name:LocationInfo, column_type:Standard,
> > comparator_type:org.apache.cassandra.db.marshal.BytesType,
> > comment:persistent metadata for the local node, row_cache_size:0.0,
> > key_cache_size:0.01, read_repair_chance:0.0, column_metadata:[],
> > gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:0,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:8,
> > memtable_operations_in_millions:0.0375), CfDef(keyspace:system,
> > name:HintsColumnFamily, column_type:Super,
> > comparator_type:org.apache.cassandra.db.marshal.BytesType,
> > subcomparator_type:org.apache.cassandra.db.marshal.BytesType,
> comment:hinted
> > handoff data, row_cache_size:0.0, key_cache_size:0.01,
> > read_repair_chance:0.0, column_metadata:[], gc_grace_seconds:0,
> > default_validation_class:org.apache.cassandra.db.marshal.BytesType, id:1,
> > min_compaction_threshold:4, max_compaction_threshold:32,
> > row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:0,
> > memtable_flush_after_mins:1440, memtable_throughput_in_mb:61,
> > memtable_operations_in_millions:0.2859375)])
> > at
> >
> org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(CassandraConnection.java:103)
> > at
> >
> org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:86)
> > at java.sql.DriverManager.getConnection(DriverManager.java:582)
> > at java.sql.DriverManager.getConnection(DriverManager.java:207)
> > at CqlTest.main(CqlTest.java:25)
> >
> > On Wed, Apr 27, 2011 at 4:27 PM, Jonathan Ellis <jbellis@gmail.com>
> wrote:
> >>
> >> What's the stacktrace?
> >>
> >> On Wed, Apr 27, 2011 at 9:45 AM, David McNelis
> >> <dmcnelis@agentisenergy.com> wrote:
> >> > I have a feeling that I'm likely doing something dumb.  I have  the
> >> > following code compiling without any issues:
> >> > String url = null;
> >> > try {
> >> >      Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver");
> >> >       url = "jdbc:cassandra:username/password@localhost
> :9160/keyspace";
> >> >       Connection conn =  DriverManager.getConnection(url);
> >> > } catch (ClassNotFoundException e1) {
> >> >    e1.printStackTrace();
> >> > }
> >> > However, at runtime I get a DriverResolverException at
> >> > CassandraConnection,
> >> > line 103, that "Required Field 'replication_factor' was not found.  I
> >> > tried
> >> > adding a Properties object with a key of "replication_factor" and a
> >> > value of
> >> > 0, but that didn't seem to make any difference whatsoever.  When I
> >> > looked at
> >> > the test classes there isn't anything showing up that looks like it is
> >> > explicitly setting a rep-factor.  Am I missing something in my attempt
> >> > to
> >> > create the connection?  Or am do I likely have something
> mis-configured
> >> > in
> >> > my cassandra instance (which is stock, outside of having data upgraded
> >> > from
> >> > 0.7.2.
> >> > --
> >> > David McNelis
> >> > Lead Software Engineer
> >> > Agentis Energy
> >> > www.agentisenergy.com
> >> > o: 630.359.6395
> >> > c: 219.384.5143
> >> > A Smart Grid technology company focused on helping consumers of energy
> >> > control an often under-managed resource.
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Jonathan Ellis
> >> Project Chair, Apache Cassandra
> >> co-founder of DataStax, the source for professional Cassandra support
> >> http://www.datastax.com
> >
> >
> >
> > --
> > David McNelis
> > Lead Software Engineer
> > Agentis Energy
> > www.agentisenergy.com
> > o: 630.359.6395
> > c: 219.384.5143
> > A Smart Grid technology company focused on helping consumers of energy
> > control an often under-managed resource.
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>



-- 
*David McNelis*
Lead Software Engineer
Agentis Energy
www.agentisenergy.com
o: 630.359.6395
c: 219.384.5143

*A Smart Grid technology company focused on helping consumers of energy
control an often under-managed resource.*

Mime
View raw message