Re: Upgrading SQL Server 2005 JDBC Driver 1.1 from SQL Server 2000 Driver, in Tomcat 5.5 env
- From: brian.egger@xxxxxxxxx
- Date: 10 Nov 2006 08:57:49 -0800
I too have been dealing with this error, we get it frequently, I don't
know why. Our broken pipe error is only a warning. I found a posting
about the broken pipe error being something harmless. The developers
from the tomcat project said they would take out that broken pipe error
in the 5.5.16 version of tomcat. As it turns out we have a machine that
was switched to that so now we see a different error, which is below.
After researching that error people say it seems to be a Tomcat
jndi/context problem. Don't know if using a different driver helped,
would really like to know if it did. Instead we are switching over to a
BMP scenario, and letting the JVM do all of the connecting for us.
Please update me on your driver situation.
Thanks
ERROR:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a
connection, pool exhausted
at
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at
com.retailcode.web.data.dao.EventsDAO.selectEvent(EventsDAO.java:174)
at
com.retailcode.web.business.EventsBusinessDelegate.fetchEvent(EventsBusinessDelegate.java:31)
at
org.apache.jsp.events.eventSignup_jsp._jspService(eventSignup_jsp.java:141)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle
object
at
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:756)
at
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
... 25 more
billy.zophar@xxxxxxxxx wrote:
Hi all,
I currently have the SQL Server 2000 JDBC driver installed on my
production Tomcat host in /usr/local/tomcat/common/lib. I have a
datasourced defined in server.xml (yeah, I know it's global, but I have
my reasons ;-) ) which I link into my servlets via a ResourceLink.
The datasource definition looks like this:
<Resource
auth="Container"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
logAbandoned="true" maxActive="100" maxIdle="50" maxWait="50000"
name="jdbc/ods"
removeAbandoned="true"
type="javax.sql.DataSource"
url="jdbc:microsoft:sqlserver://sql.example.com:1433;DatabaseName=SuperDB"
username="servlet_user"
password="xxxxxxxxx"
/>
I was finding that when service was interrupted on the SQL Server end
of things, Tomcat seemed to be hanging onto bad connection pool
objects. I don't know if this was the fault of the MS driver, or
Tomcat's DBCP libraries. A connection would be passed to the servlet
which would then throw an exception reporting a "Broken Pipe" upon the
first attempt to execute a query.
So, I saw that the new driver, SQL Server 2005 JDBC v1.1 was out, and
also supported SQL Server 2000. So, on my test host, I removed the old
jar files and put the new sqljdbc.jar file in tomcat's common/lib
directory.
I updated the data source definition like thus:
<!-- JDBC resource for ODS DB -->
<Resource
auth="Container"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
logAbandoned="true" maxActive="100" maxIdle="10" maxWait="50000"
name="jdbc/ods"
removeAbandoned="true"
type="javax.sql.DataSource"
url="jdbc:sqlserver://sql.example.com:1433;DatabaseName=SuperDB"
username="servlet_user"
password="xxxxxxxxx"
/>
That works super. As you can see not much change with the exception
that the :microsoft is no longer in the url attribute. But I really
struggled with the driverClassName attribute. When I set
driverClassName to either
'com.microsoft.sqlserver.jdbc.SQLServerXADataSource'
or
'com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource'
I got the exception:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class
'com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource' for
connect URL
'jdbc:sqlserver://sql.example.com:1433;DatabaseName=SuperDB'
Those are the two class names recomended for data source defintions by
the driver's documentation. I'm not sure if that implies an error in
the docs, or if I'm just not quite understanding how JNDI references,
Tomcat, and this driver work together. I'm pretty sure Tomcat just
goes ahead and looks for the the connection pooling implementation
within the driver, which is why it was pooling the connections before.
Interesting stuff. I figured this might be of use to anyone else out
there.
Also, if anybody has any info on why I might have kept running into
this exception with the old driver, I'd be appreciative:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Broken pipe
at
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.submitRequest(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown
Source)
at
com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown
Source)
at
com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown
Source)
at
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
[snip]
I'll find out whether I still have this problem with the new driver in
my current environment soon. The solution was to either wait until the
pool of bad connections was exhausted (not acceptable!!!), or to
restart Tomcat to get it to refresh the pool.
B
.
- Prev by Date: RE: No TDS_RET_STATUS was found
- Next by Date: TDS_RET_STATUS exception
- Previous by thread: RE: No TDS_RET_STATUS was found
- Next by thread: RE: Upgrading SQL Server 2005 JDBC Driver 1.1 from SQL Server 2000 Driver, in Tomcat 5.5 env
- Index(es):
Relevant Pages
|
Loading