db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Lichtas" <elich...@linoma.com>
Subject Starting embedded Derby Replication within Tomcat web application
Date Fri, 08 Jan 2010 14:10:15 GMT
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);

                  }

            }

            ds.getConnection();

 

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

 

 <http://www.linomasoftware.com/> Linoma-Software-Logo

1409 Silver Street, Ashland, NE 68003

1-800-949-4696 x714

 


Mime
View raw message