This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Connection Pooling Problem In Tomcat

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only when googling doesn't help
javax.naming.NamingException: Cannot create resource instance
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic