Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pool Exception

 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There can be two errors, first the connections in the application server are not configured correctly or second the jndi name of your datasources is wrong. I don't know it exactly, but must it not something like "jdbc/dbname" ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic