aspose file tools*
The moose likes Tomcat and the fly likes Connection Pooling Problem In Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Connection Pooling Problem In Tomcat" Watch "Connection Pooling Problem In Tomcat" New topic
Author

Connection Pooling Problem In Tomcat

Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

Only when googling doesn't help
javax.naming.NamingException: Cannot create resource instance


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Bennet Xavier
Ranch Hand

Joined: Jun 19, 2008
Posts: 162
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Pooling Problem In Tomcat