Your treading new ground - I think you may be the first person to try
this with axis2 and spring.

In the ClassPathXmlApplicationContext class , as shown in startUp() in
the aar scenario , there is a constuctor that supports passing the
parent ApplicationContext . So what I would try first is putting the
ApplicationContextHolder bean at the Servlet level / parent
application context level.

From there there you could try using the axis2 class
ApplicationContextHolder static method getContext() to use that for
the parent app ctx arg in startUp() . That may introduce classloader
issues since that took a while to get right, though it may just work.
Alternatively, forget the services.xml spring config and the lifecycle
stuff , and just use getContext().getBean() in each service in a
locally configured, yet another bean that implements
ApplicationContextAware.

I'm probably forgetting something but that should get you started.
This would be kool if you got it working so let us know about your
progress . It'd be kool, if you were interested, you're able to, and
it works in the end, to get this in the docs.

HTH,
Robert

On 1/10/07, Trevor McCullough <[EMAIL PROTECTED]> wrote:
I am trying to figure out if I can integrate spring with axis2 outside and
inside the aar at the same time.

For instance I have a bunch of services implemented within their own .aar
file and I want them to each have their own spring application context, but
also when I create that application context in the startup() method in each
of my Services I want to set a parent application context that is defined
outside the aar. The idea being is that beans defined outside the aar
provide shared services such defining a 'datasource' bean to beans defined
within the aar.

So can the two methods of creating an application context inside and outside
the aar co-exist together - I see that the docs suggest that when using the
outside aar approach that the axis2-spring-*.jar files must be moved from
WEB-INF/lib so I don't see how the spring application context could be
created outside the aar.


Many Thanks
Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to