• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling Problem In Tomcat

 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a webapp which us deployed in tomcat5.5.27, which is configured for Connection Pooling with Oracle11g.

webapp/WEB-INF/web.xml contains.



webapp/META-INF/context.xml contains.



and servlet Init method contains.

public void init(ServletConfig config) throws ServletException {
try {
// Look up the JNDI data source only once at init time
Context envCtx = (Context) new InitialContext().lookup("java:comp/env");
ods = (OracleDataSource) envCtx.lookup("jdbc/oracleconn");
// ods = RMSDatabaseManager.getInstance().loadDataSources();
for (int i = 0; i < 100; i++) {

connection[i]=ods.getConnection();
System.out.println(i+" >>>>>>>>>>>>>"+connection[i]+"<<<<<<<<<<<<<<");

}

}
catch (Exception e) {
e.printStackTrace();
}
}

I am using.
ojdbc5.jar and orai18n.jar

I am getting :

javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)

Please reply,

Thanks In Advance,
Bennet Xavier.

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You for your reply.

But those thing didnt helped me.

I tried all those things.

I am using 11g. and did what ever mentioned there it didnt worked.

then, I tried in context.xml



then i am getting the connections, But I am getting connection more than what ever i have configured.

Waiting for Your Reply.

Bennet Xavier
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic