db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Lichtas" <elich...@linoma.com>
Subject RE: Starting embedded Derby Replication within Tomcat web application
Date Mon, 11 Jan 2010 18:25:48 GMT
Thanks for the reply Dag,

It seems that problems occur when using a connection pool for the embedded
derby database.
If I simply make a connection to the master db, not using the JNDI
DataSource, the master/slave report that they start up fine; the slave
acknowledges that it is in replication mode.

When the first couple database transactions are ran, the errors below are
produced in the derby.log file

Note that after that connection is made, the rest of the transactions
against the master are made using the DataSource connection pool with the
url: "jdbc:derby:C:\Dev\Derby Databases\testdb". It doesn't seem like this
could cause a problem, because the master is still attempting to send logs
to the slave, but the connection is failing?  Any thoughts would be
appreciated.

derby.log file
----------------------------------------------------------------
2010-01-11 17:46:23.343 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby -
10.5.3.0 - (802917): instance a816c00e-0126-1e7e-5da3-00000746e068
on database directory C:\Dev\Derby Databases\testdb  

Database Class Loader started - derby.database.classpath=''
Replication master role started for database 'C:\Dev\Derby
Databases\testdb'.
----  BEGIN REPLICATION ERROR MESSAGE (1/11/10 11:47 AM) ----
Exception occurred during log shipping.
java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(Unknown Source)
	at java.net.SocketOutputStream.write(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown
Source)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown
Source)
	at java.io.ObjectOutputStream.reset(Unknown Source)
	at
org.apache.derby.impl.store.replication.net.SocketConnection.writeMessage(Un
known Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.sendM
essage(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.shipAL
ogChunk(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.run(Un
known Source)

--------------------  END REPLICATION ERROR MESSAGE ---------------------
Replication master trying to reconnect to slave for database 'C:\Dev\Derby
Databases\testdb'.
----  BEGIN REPLICATION ERROR MESSAGE (1/11/10 11:47 AM) ----
Exception occurred during log shipping.
java.security.PrivilegedActionException: java.net.ConnectException:
Connection refused: connect
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.initC
onnection(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.handleExcept
ions(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.run(Un
known Source)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit$1.run
(Unknown Source)
	... 4 more
============= begin nested exception, level (1) ===========
java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit$1.run
(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.initC
onnection(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.handleExcept
ions(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.run(Un
known Source)
============= end nested exception, level (1) ===========

--------------------  END REPLICATION ERROR MESSAGE ---------------------
----  BEGIN REPLICATION ERROR MESSAGE (1/11/10 11:47 AM) ----
Exception occurred during log shipping.
java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(Unknown Source)
	at java.net.SocketOutputStream.write(Unknown Source)
	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown
Source)
	at
java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown
Source)
	at java.io.ObjectOutputStream.reset(Unknown Source)
	at
org.apache.derby.impl.store.replication.net.SocketConnection.writeMessage(Un
known Source)
	at
org.apache.derby.impl.store.replication.net.ReplicationMessageTransmit.sendM
essage(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.shipAL
ogChunk(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.flushB
uffer(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.stopMaster(U
nknown Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.printStackAn
dStopMaster(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.MasterController.handleExcept
ions(Unknown Source)
	at
org.apache.derby.impl.store.replication.master.AsynchronousLogShipper.run(Un
known Source)

--------------------  END REPLICATION ERROR MESSAGE ---------------------
Replication master role stopped for database 'C:\Dev\Derby
Databases\testdb'.

Thanks,
Erick Lichtas

-----Original Message-----
From: Dag.Wanvik@Sun.COM [mailto:Dag.Wanvik@Sun.COM] 
Sent: Saturday, January 09, 2010 1:05 PM
To: Derby Discussion
Subject: Re: Starting embedded Derby Replication within Tomcat web
application

Erick Lichtas <elichtas@linoma.com> writes:

> 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.

Yes, this error indicates that the start master connection URL is
attempted used over again after the database has already been
successfully booted as a master.

The fact that it works outside of Tomcat seems to point the finger at
Tomcat's usage/db booting. I don't know how/when Tomcat does this,
though.

Dag


__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4760 (20100111) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4762 (20100111) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


Mime
View raw message