File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Pool Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Pool Exception" Watch "Pool Exception" New topic
Author

Pool Exception

Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
When i run this program

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class DD11 extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
Connection con=null;
Statement st=null;
ResultSet rs=null;
res.setContentType("text/html");
java.io.PrintWriter out = res.getWriter();
String tcnt=null;
try {

Context cx = new InitialContext();
DataSource ds = (DataSource)cx.lookup("oradsn");
out.println("the DataSource is :"+ds);
con=ds.getConnection();
out.println("ORADSN Connection created"+con);
}catch(Exception e) {
e.printStackTrace(out);
}
}
}

i got this excecption ...................

java.sql.SQLException: weblogic.common.ResourceException: No available connections in pool oradsn at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:250) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:270) at DD11.service(dd11.java:32) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5363) at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2466) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,
I think your connection Pool exceeds the number of connection object currently available. OR pls check your configuration for connection pool.Also pls let me your weblogic server version.
Regards,
M.S.Raman
Originally posted by glkrr reddy:
When i run this program

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class DD11 extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
Connection con=null;
Statement st=null;
ResultSet rs=null;
res.setContentType("text/html");
java.io.PrintWriter out = res.getWriter();
String tcnt=null;
try {

Context cx = new InitialContext();
DataSource ds = (DataSource)cx.lookup("oradsn");
out.println("the DataSource is :"+ds);
con=ds.getConnection();
out.println("ORADSN Connection created"+con);
}catch(Exception e) {
e.printStackTrace(out);
}
}
}

i got this excecption ...................

java.sql.SQLException: weblogic.common.ResourceException: No available connections in pool oradsn at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:250) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:270) at DD11.service(dd11.java:32) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5363) at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2466) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
In my opinion the error occurs when retrieving the DataSource over JNDI. Normaly JDBC connections are stored in the context jdbc, so you should use
DataSource ds = (DataSource)cx.lookup("jdbc/oradsn");
If you don't have enough connections the application server should handle this(lets applciation wait) and it must work at least one time.
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
Hi

I facing one pbm .I using weblogic7.0 now and working too.I wrote one database pgm through connectionnpool.When i run this program first time
its working fine and exact results too.
After some time when i run again same program
i got this exception ....................................................................... whats the reason for this one.Even though oradsn is cc reated also showing no oradsn connectionpool...so pls let me now .............
weblogic.common.ResourceException: No available connections in pool oradsn
at weblogic.jdbc.common.internal.ResourceAllocator.reserve(ResourceAlloc
ator.java:800)
at weblogic.jdbc.common.internal.ResourceAllocator.reserve(ResourceAlloc
ator.java:661)
at weblogic.jdbc.common.internal.ResourceAllocator.reserveNoWait(Resourc
eAllocator.java:619)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.j
ava:166)
at weblogic.jdbc.common.internal.ConnectionPool.reserveNoWait(Connection
Pool.java:128)
at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiData
Source.java:246)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:270)
at DD11.service(dd11.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:945)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:332)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:5363)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:721)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3043)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2466)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pool Exception