MarshalException is thrown when cassandra-cli creates the example Keyspace 
specified by conf/schema-sample.txt
--------------------------------------------------------------------------------------------------------------

                 Key: CASSANDRA-2390
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2390
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 0.7.5
            Reporter: Jingguo Yao


Use the following steps to recreate the bug:

1. Checkout the source code from trunk. For my case, revision is 1085753.
2. Run "ant" to build cassandra.
3. Run "bin/cassandra -f" to start cassandra.
4. Run "bin/cassandra-cli -host localhost --file conf/schema-sample.txt".

Then there is the following message:
{quote}
... schemas agree across the cluster
Line 9 => org.apache.cassandra.db.marshal.MarshalException: cannot parse 
'birthdate' as hex bytes
{quote}
The root cause is BytesType's fromString method. FBUtilities's hexToBytes 
method is invoked with "birthdate". NumberFormatException is thrown since 
"birthdate" is not a hex string.

{code:title=BytesType.java|borderStyle=solid}

    public ByteBuffer fromString(String source)
    {
        try
        {
            return ByteBuffer.wrap(FBUtilities.hexToBytes(source));
        }
        catch (NumberFormatException e)
        {
            throw new MarshalException(String.format("cannot parse '%s' as hex 
bytes", source), e);
        }
    }
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to