axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robert lazarski" <>
Subject Re: Axis2 and Spring: Preserving Service Isolation
Date Wed, 23 Aug 2006 22:53:05 GMT
Yes, the spring docs are focused so far on the simpler cases.
Configuring spring via na AAR isn't documented yet as I need to do
more testing, but to asnswer your question I need to know where do you
want to load the spring.jar from , inside the AAR or WEB-INF/lib ?

If the spring.jar is loaded from WEB-INF/lib , that's no problem and I
can show you how to load your applicationContext.xml / beanRef.xml
from the aar to configure Spring and you can use the
ServiceObjectSupplier method to wire your beans as explained in the
docs. One caveat: I need to test this with multiple AAR's, but my
initial tests shows that it can work for one AAR .

If the spring.jar is loaded inside the AAR , you still can load your
applicationContext.xml from the aar. I'm still thinking thru, however,
if you wanted to how you could use the ServiceObjectSupplier in that
case . That's because the Spring ApplicationContext object, in the
spring jar inside the aar case , will not be visible at the
WEB-INF/lib level where the AbstractMessageReceiver will attempt to
wire the bean. There's probably a solution here but I still need to
think it thru.

In the case of the latter, perhaps I can get
AxisService.getClassLoader() at the ServiceObjectSupplier /
AbstracMessageReceiver level to get the spring ApplicationContext
object (not the xml file) from the AAR/lib/spring.jar , though that
may not work in terms of classloader isolation. Someone such as Dims
or Deepal may be able to comment .

In any case, the solution at the service level will involve the
service implementing the  org.apache.axis2.engine.Service interface
and doing the spring config in init() . There is a blocker for the
next release, axis2-1033, that when resolved will permit init() to be
called on server startup much like a servlet load on startup. My
spring inside an aar tests have been calling a service first that
configures spring until axis2-1033 is resolved. Once you let me know
which scenario you have in mind I'll work with you to get it


On 8/23/06, Declan Dunleavy <> wrote:
> Hi,
> I emailed Robert Lazarski to get more information about integrating Axis2
> with Spring, to which he helpfully pointed me to the following solution:
> > Spring support is in the nightlies:
> >
> >
> >
> > Its documented here:
> >
> >
> This solution outlined here requires the Spring applicationContext.xml to
> live outside the AAR service file in the Axis2 WEB-INF folder and is
> configured within the web.xml, which is not as modular as I would like.
> I was wondering if there's any way to preserve service isolation by
> incorporating the ApplicationContext.xml / BeanFactory.xml inside the AAR.
> As I would prefer not to have to update the axis2 WEB-INF folder
> applicationContext.xml file with updates to the AARs bean classes every time
> I release new code. I wasn't sure if it was possible but thought I'd ask
> Robert anyway. He suggested I post the question here.
> Thanks in advance for any replies,
> Declan

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message