File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Connection Pooling with Axis2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Connection Pooling with Axis2" Watch "Connection Pooling with Axis2" New topic

Connection Pooling with Axis2

Jeff Boucher

Joined: Aug 18, 2008
Posts: 14
I have a (probably) fairly technical question about connection pooling with Axis2 I'd like to throw out there, in case someone else has come across this.

I'd like to deploy a POJO that connects to a DB backend through Axis2 on Tomcat, using the .aar archive to deploy. I managed to get it working with a connection pool the usual way (described on the tomcat site) by creating a resource in META_INF/context.xml and a resource-ref in the web.xml in WEB-INF.

In dev, this is not a big deal, but in production, I don't want to tinker with files that may affect other applications. For standard web development, I've been able to configure these things specifically for a webapp by editing the files in META-INF and WEB-INF within the application's directory structure. But unfortunately, I don't see a way to edit files specific to a .aar archive (in fact, I'm not sure an .aar file even has a service-specific WEB-INF or META-INF directory). This leaves me editing files the META-INF and WEB-INF for all the applications in Axis2, rather than just my own particular app.

Anyway - with that background, is there a way to do this? Or am I stuck with editing the apps in Axis2/WEB-INF and Axis2/META-INF for connection pooling?

Hope this makes sense - please ask me for any clarifications if it doesn't make sense - I'm fairly new to Axis2, still figuring it out.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

First off, an .aar file does have a META-INF directory, but it's not for context.xml, but for service.xml (which does something completely different). It also doesn't have a WEB-INF/web.xml file.

But I don't really see a problem with adding appropriate entries to the respective files of the web app. You only need to do this once, and you can give the pool a distinctive name, so that there's no interference with other pools. Can you elaborate on why you don't want to go down that path?
Jeff Boucher

Joined: Aug 18, 2008
Posts: 14
<Can you elaborate on why you don't want to go down that path?>

Well, I'm certainly *willing* to go down that path, but I generally prefer to keep deployment self-contained. It's similar to why I might use the local lib for application-specific jar files, rather than putting them in the top level directory.

I know, technically, it isn't quite the same thing - because these are just elements in a config file, not different versions of a jar, so as long as I'm careful, it should be fine. But editing a config used by all apps definitely increases the chances of hosing all the apps running on that server, whereas a self-contained deployment reduces the chances of this happening. Even a minor typo can really mess everything up.

But it sounds like I'll have to do it this way if I want to use an .aar file, because there's no local WEB-INF.
I agree. Here's the link:
subject: Connection Pooling with Axis2
It's not a secret anymore!