Re: Embedded Cassandra issues

1,187 views
Skip to first unread message

Zack Maril

unread,
Apr 1, 2013, 6:05:53 PM4/1/13
to aureliu...@googlegroups.com
I think I have. Check that you are using a cassandra.yaml from the correct version of cassandra. There are breaking changes between some recent versions and you have to use the same version that the version of Titan does. Try something like this maybe:

On Tuesday, April 2, 2013 1:22:47 AM UTC+4, Steven McCraw wrote:
Hi All,

I'm having issues getting embedded Cassandra to work as my back end.  Here's the stack trace that I get when I call TitanFactory.open with storage.backend="embeddedcassandra" (and storage.cassandra-config-dir pointing to the default cassandra yaml file):

0    [pool-1-thread-1] INFO  org.apache.cassandra.service.CassandraDaemon  - JVM vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.7.0_07
2    [pool-1-thread-1] INFO  org.apache.cassandra.service.CassandraDaemon  - Heap size: 139853824/466092032
2    [pool-1-thread-1] INFO  org.apache.cassandra.service.CassandraDaemon  - Classpath: /Users/mamccr/datastore/titan-cassandra-0.3.0/lib/cassandra-all-1.2.2.jar
101  [pool-1-thread-1] INFO  org.apache.cassandra.utils.CLibrary  - JNA link failure, one or more native method will be unavailable.
108  [pool-1-thread-1] INFO  org.apache.cassandra.config.DatabaseDescriptor  - Loading settings from file:/Users/mccraw/Documents/datastore/cassandra.yaml
142  [pool-1-thread-1] ERROR org.apache.cassandra.config.DatabaseDescriptor  - Fatal configuration error error
Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Class not found: org.apache.cassandra.config.Config
 in 'reader', line 10, column 1:
    cluster_name: 'Test Cluster'
    ^

at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:333)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:182)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:141)
at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:127)
at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:412)
at org.apache.cassandra.config.DatabaseDescriptor.loadYaml(DatabaseDescriptor.java:147)
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:122)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:150)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:366)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:409)
at com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraDaemonWrapper$CassandraStarter.run(CassandraDaemonWrapper.java:64)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.yaml.snakeyaml.error.YAMLException: Class not found: org.apache.cassandra.config.Config
at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:633)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:321)
at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331)
... 17 more
null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Class not found: org.apache.cassandra.config.Config;  in 'reader', line 10, column 1:
    cluster_name: 'Test Cluster Bar'
    ^
Invalid yaml; unable to start server.  See log for stacktrace.


Has anyone seen anything like this before?  It seems at first glance to be a class loading issue, but notice that org.apache.cassandra.config.DatabaseDescriptor is in the stack trace, and it is in the same package as org.apache.cassandra.config.Config (the class that supposedly can't be found), so that strikes me as maybe a red herring.

Thanks!
Mark

Steven McCraw

unread,
Apr 1, 2013, 10:59:10 PM4/1/13
to aureliu...@googlegroups.com
Zack,

Thanks for the reply!  I contacted the Cassandra people on IRC as well, and they had the same idea, that it was probably the yaml formatting. I tried your suggestion, and also the yaml file in the config directory that shipped with apache-cassandra, but to no avail. I'm wondering now if it might be a yaml class loading conflict (I'm using this with JRuby, which also uses snake yaml). I wonder if there is a way to initialize Cassandra with anything other than a yaml file?  For instance, can you just pass a hash in to some method instead?  Or does anyone know of a way to get better error messages (assuming the class not found message is in fact misleading)?

Sent from my mobile device. Apologies for brevity.
--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Antonio VonG

unread,
Apr 1, 2013, 11:23:55 PM4/1/13
to aureliu...@googlegroups.com
file:/Users/mccraw/Documents/datastore/cassandra.yaml

i haven't used Windows for a long time but that doesn't look like a valid uri to me?

Note – When running Titan Server on Windows, the example titan-server-cassandra.properties file expects a the path to acassandra.yaml file to be a full URL as in: file:///c:/titan-cassandra-0.3.0/config/cassandra.yaml

hope this helps.

Mark McCraw

unread,
Apr 2, 2013, 8:41:42 AM4/2/13
to aureliu...@googlegroups.com
Hi Antonio,

I'm on Mac OS.  I tried monkeying around with the URL (file:/ vs file:///, etc) but same results always.  Also, it's definitely opening and reading the file, because it's giving me the correct line number of the first non-comment in the yaml file.  Thanks for the idea, though.

Mark

Antonio VonG

unread,
Apr 2, 2013, 10:34:53 AM4/2/13
to aureliu...@googlegroups.com
Try drop the "file", "/Users/mccraw/Documents/datastore/cassandra.yaml" should work.
if it's doesn't, try open a terminal, enter
ls /Users/mccraw/Documents/datastore/cassandra.yaml
if it says No such file or directory, your file path is wrong.

hope this helps.

Steven McCraw

unread,
Jun 26, 2013, 8:34:44 AM6/26/13
to aureliu...@googlegroups.com
Hi All,

A coworker hit this problem yesterday, and after finding this thread, informed me that I never followed up with a resolution.  The problem turned out to be a classloading issue.  I'm using JRuby, and at the time, was loading the jars at runtime instead of adding them to the classpath at startup time.  My hunch is that dynamic loading of jars in JRuby doesn't append to the native classloader's class path, and so classes just couldn't be found.  Making those jars more globally available via startup script for my application which laboriously concatenated all the jars together to specify the classpath explicitly fixed the problem.

Thanks for all the help and suggestions.

Mark
Reply all
Reply to author
Forward
0 new messages