0

If i have a JAR file project with several database connections and several dozen service classes configured with Spring 3.1, how do i go about packaging it and deploying it to my Jboss 7.1 server in such a way that the other 35 projects in my system can have a client class as a dependency with the interfaces, and then autowire the services?

The goal here is to do something similar to EJB3's where i have a single service project that handles the database access, then my other 35 war files use that service instead of creating their own individual database connections.

im still reading the IoC container documentation but it seems to me that everything (at the moment) is geared towards everything being contained in one war/ear/whatever file. I don't have that environment.

How do i package this?

scphantm
  • 4,293
  • 8
  • 43
  • 77

1 Answers1

0

Try adding the service classes and their wiring to JBOSS/server/<configuration>/lib as explained here Where to put a shared library in JBoss AS 5?. They should be loaded only once and shared among all the applications.

Community
  • 1
  • 1
John Watts
  • 8,717
  • 1
  • 31
  • 35
  • Thats what we do with the current version of the system. The problem is spring is never fired on the library until the application calls it. then the class loader loads a copy of the library for each application and when each application fires spring, i end up with 1400 active database connections and a very cranky AS/400 admin (8 databases * 35 applications * 5 connection pools per db = 1400 DB connections) – scphantm Jul 25 '12 at 11:47