ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Andrews <peter.andr...@Dartmouth.EDU>
Subject Multi threaded app gets java.netBindConnection: Address already in use: connect
Date Thu, 28 Dec 2006 19:15:56 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hello,<br>
<br>
I am using iBATIS to retrieve data on multiple threads simultaneously.
I have experienced this problem with the svn </font></font><font
 size="-1"><font face="Helvetica, Arial, sans-serif">2.3.0 .xxx </font></font><font
 size="-1"><font face="Helvetica, Arial, sans-serif">version and also
the 2.2.0 GA release.<br>
<br>
I get the error if I use DBCP or SIMPLE for my datasource. The value of
'commitRequired' has no effect on whether the exception occurs. Once
the first exception occurs, there are dozens.<br>
<br>
&nbsp; &lt;transactionManager type="JDBC" commitRequired="true"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;dataSource type="SIMPLE"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="JDBC.ConnectionURL"
value="jdbc:<a class="moz-txt-link-freetext" href="mysql://${geneDatasetDb.hostAndPort">mysql://${geneDatasetDb.hostAndPort</a>}/geneDataset"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="JDBC.Username"
value="${geneDatasetDb.username}"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="JDBC.Password"
value="${geneDatasetDb.password}"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="Pool.MaximumActiveConnections"
value="${geneDatasetDb.maximumActiveConnections}"/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/dataSource&gt;<br>
&nbsp; &lt;/transactionManager&gt;<br>
<br>
Here is the stack trace:<br>
com.mysql.jdbc.CommunicationsException: Communications link failure due
to underlying exception: <br>
<br>
** BEGIN NESTED EXCEPTION ** <br>
<br>
java.net.SocketException<br>
MESSAGE: java.net.BindException: Address already in use: connect<br>
<br>
STACKTRACE:<br>
<br>
java.net.SocketException: java.net.BindException: Address already in
use: connect<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.mysql.jdbc.MysqlIO.&lt;init&gt;(MysqlIO.java:276)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.mysql.jdbc.Connection.&lt;init&gt;(Connection.java:1531)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.sql.DriverManager.getConnection(DriverManager.java:525)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.sql.DriverManager.getConnection(DriverManager.java:171)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:580)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:565)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:540)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:84)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.epistasis.db.SqlMapClientWrapper.queryForObject(SqlMapClientWrapper.java:60)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
org.epistasis.db.geneAnnotation.GeneAnnotationDbAccess.getGeneById(GeneAnnotationDbAccess.java:113)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.epistasis.db.geneDataset.Dataset$4.run(Dataset.java:631)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.util.concurrent.FutureTask.run(FutureTask.java:123)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.Thread.run(Thread.java:595)<br>
<br>
<br>
** END NESTED EXCEPTION **<br>
<br>
Anyone have ideas/suggestions?<br>
<br>
Thanks,<br>
<br>
Peter<br>
<br>
<br>
</font></font>
<pre class="moz-signature" cols="72">-- 
--------------
Peter Andrews
Software Engineer
Dartmouth Medical School
Computational Genetics
Rubin 707
(603) 653-3598</pre>
</body>
</html>


Mime
View raw message