• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic