I've had success with the following approach.
- Make sure to compile with
-g
(use like:javac -g
) to enable generation of all debugging information. - When starting your application use appropriate debug flags (like so
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1414
, the number is the port you connect to) to start a debugging server. Note that you can debug from a remote host (debugger will connect using hostname:port syntax). You don't need to type this all up for Cassandra; you can simply uncomment a relevant line incassandra-env.sh
(in Windows, look inbin/Cassandra.bat
or if running Datastax distro, under registry keyHKLM\SOFTWARE\[optionally Wow6432Node\]Apache Software Foundation\[Procrun node]\[Cassandra node]\Parameters\Java:Options
). - Connect to your server from your IDE (I used Eclipse, IntelJ is similar, I'm sure).
- Open the source code in the IDE and put some breakpoints that would be in play in your use case.
- Run your scenario. Your breakpoints should hit. For definite confirmation that the setup works, put a breakpoint on something that is guaranteed to be executed during your scenario, rather than on something you believe should.
In your case, because you can successfully specify the keyspace, I believe everything is working, and then there is a silent failure when you try to do other steps, possibly introduced by your modifications. To confirm, I would recommend rolling back all your changes and first testing the debugger setup on a clean build.
Lastly, and this may be superfluous, CQLSH is a program written in Python, and runs separate from Cassandra in a different process. Therefore you cannot see the actual "command line entry" from a Java debugger. The closest you can get to your raw input is by putting breakpoints somewhere in cql3
package to see CQL statements get passed in (hopefully). Of course you can use a Python debugger to debug CQLSH if this is what you want.