Hi all,


I have a web application using derby in embedded mode.  This application is running on tomcat 6 web server.  I am trying to set up master/slave replication to another derby database, also in embedded mode.  For this setup, both databases are on the same host and the version of Derby that I am using is 10.5.3.  Before starting the replication, I make sure the master is completely shut down, and make a fresh copy to the slave location.


The problem I am having is that when I start the master database, I am getting the error message

ERROR XRE22: Replication master has already been booted for database 'C:\Dev\Derby Databases\test'


The slave seems to have accepted the connection as I get the exception with state XRE08 (which according to the documentation means the slave accepted the connection from the master)


Everything seems to be set up right.  If I start the replication with the databases outside of the tomcat container, using some client like SQuirreL SQL or MyEclipse DB explorer, I can get the replication working just fine.


When the web app starts, I am making the connection with ‘startMaster=true;slavePort=5555’ as the first thing in my context startup listener.  I am starting it using a data source I have defined in tomcat’s server.xml


DataSource ds = null;

            if (ds == null) {

                  if (ds == null) {

                        Context context = new InitialContext();

                        ds = (DataSource) context.lookup(JNDI_NAME_START);





Upon making the call to ds.getConnection(), this is when the slave accepts the connection and I get the exception with error XRE22 noted above.  Based on the error message, it looks like the master has already been started for some reason…


Any thoughts would be very much appreciated.


Thanks in advance,



Erick Lichtas



1409 Silver Street, Ashland, NE 68003

1-800-949-4696 x714


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4753 (20100108) __________

The message was checked by ESET NOD32 Antivirus.