Here is what worked for me, I use testNg, and initialize and createschema in the @BeforeClass for each test
- In the @AfterClass, I had to drop schema, otherwise I was getting the same exception. - After this I started getting port conflict with the second test, so I added my own version of EmbeddedCass.. class, added a stop which calls a stop on the cassandradaemon (which from code comments seems to closes the thrift port) On Thu, Jan 20, 2011 at 1:32 PM, Aaron Morton <aa...@thelastpickle.com>wrote: > Do you have a full error stack? > > That error is raised when the schema is added to an internal static map. > There is a lot of static state so it's probably going to make your life > easier if you can avoid reusing the JVM. > > Im guessing your errors comes from AbstractCassandraDaemon.setup() calling > DatabaseDescriptor.loadSchemas() . It may be possible to work around this > issue, but I don't have time today. Let me know how you get on. > > Aaron > > > On 21/01/2011, at 12:46 AM, Roshan Dawrani <roshandawr...@gmail.com> > wrote: > > Hi, > > I am using Cassandra for a Grails application and in that I start the > embedded server when the Spring application context gets built. > > When I run my Grails app test suite - it first runs the integration and > then functional test suite and it builds the application text individually > for each phase. > > When it brings the up the embedded Cassandra server in 2nd phase (for > functional tests), it fails saying "*Attempt to assign id to existing > column family.*" > > Anyone familiar with this error? Is it because both the test phases are > executed in the same JVM instance and there is some Cassandra meta-data from > phase 1 server start that is affecting the server startup in 2nd phase? > > Any way I can cleanly start the server 2 times in my case? Any other > suggestion? Thanks. > > -- > Roshan > Blog: <http://roshandawrani.wordpress.com/> > http://roshandawrani.wordpress.com/ > Twitter: @roshandawrani <http://twitter.com/roshandawrani> > Skype: roshandawrani > >