• 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 with Axis2

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<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.
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic