aspose file tools*
The moose likes Tomcat and the fly likes The answer will contain the word Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "The answer will contain the word "classloader"" Watch "The answer will contain the word "classloader"" New topic
Author

The answer will contain the word "classloader"

William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

Follow on to this post
I hava two Tomcat jars which support connection pooling. Which one am I using? I don't think there is any difference in the application code, which is making the db calls. I suppose I could swap the files out, only have one in the directory at a time. But I am assuming there is a smarter way of figuring this out. And it will include the word "classloader".


Please ignore post, I have no idea what I am talking about.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

So I took the brute force method and swapped these jar files out of $CATALINA_HOME/lib The result was that tomcat-dbcp.jar is not used, because I was able to recreate the issue when it the jar was not available. This is good to know, but doesn't help me, as the suggestions on the internet to address the "max open cursors exceeded" issue was to use tomcat-jdbc.jar for the connection pooling. But I am already doing that.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Huh?

Connection Pools are plug-in components. You can have as many different connection pool implementations as you like - even concurrently, since the choice of which pool implementation you use is made by supplying its primary classname in the pool resource definition in the Tomcat server or Context.

And, yes, no changes should be required to applications unless they are explicitly using pool-specific features, since the actual application interface is the DataSource returned from Tomcat by JNDI.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

Tim Holloway wrote:the choice of which pool implementation you use is made by supplying its primary classname in the pool resource definition in the Tomcat server or Context.


This I am not seeing. I don't see this defined any where. Which leads to my general confusion on the topic. Do you have an example of what this would look like in the configs?

Thanks.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984


Reviewing this page again, I noticed that my server.xml didn't have this line.



Added that, and still have the exact same issue. That jar was already getting used before adding that line to server.xml. I proved that when I removed tomcat-jdbc.jar and got this error



So what is my question?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

You never actually named the jdbc pool jars in question unless my bleary eyes deceive me. Nor indicated where they came from. I take it as a given that one of them shipped with Tomcat, but what about the other?

Although you can specify which pooler you want to use in the server config, if you have a classpath conflict, it's still a classpath conflict.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The answer will contain the word "classloader"
 
Similar Threads
Strange NoClassDefFoundError with obfuscated build
Can sandbox model distinguish between local and remote calls?
ClassCastException
Get classpath for current running thread
Help! findResource isn't working!