Hi Rajith, Here is how I am putting my application
together. I have a set of core services that are Spring beans. I
use Hibernate as my persistence tier. The Web services layer calls a
Spring service that implements the business logic. Axis2’s Spring support allows the
developer to expose Spring beans as Web Services. However, I don’t
really want to expose my Spring beans directly as Web Services. My main
motivation for this is that I can change the service interfaces without
affecting my public Web services interface. I can also hide some service
interfaces that are used by other services but should not be publicly available
(I could also just not expose them in the WSDL too). I am also thinking
it might help me with versioning down the road since I can have different Web
service endpoints for different versions of my API. My main issues with using Axis2 and Spring
revolved around the Service classloader. Spring likes to use the context
classloader which does not have access to the resources deployed with the
service. I tried setting the classloader for Spring (one can set the
classloader for the application context and the bean loader) but I ran into
some problems with setting properties on Spring beans that I chalked up to
permissions issues. My current workaround is ugly but it works. I
deploy the Spring jars and the core services jar in the WEB-INF/lib for Axis2.
My service I do want to try the latest build.
The changes in the Service classloader look promising. Unfortunately I am going
on vacation for a few days after today. I am also trying to do a QA drop
before I go so I am quite busy today. That means I can’t try the
nightly build until late next week. I would really like to not have to
mess with the axis2.war so I am eager to try it out. Thanks for the quick response on the issue
though. Dave From: Rajith Attapattu
[mailto:[EMAIL PROTECTED]
On 7/31/06, Dave
Andreasen <[EMAIL PROTECTED]>
wrote: I had the same issue. The problem is related to the
Service using it's own classloader and Spring wanting to use the thread context
classloader. See http://issues.apache.org/jira/browse/AXIS2-400. There have been some extensions made to support Spring in
Axis2 in the nightly builds. You try pulling them down to see if they
help you out. Look at JIRA issue http://issues.apache.org/jira/browse/AXIS2-272
for more information I didn't use the extensions because they didn't apply to the
approach we used for creating our Spring beans. I did create an Axis
module that loads my Spring beans on Axis startup. Hope this helps! Dave Andreasen From: Shaowei Mao [mailto:[EMAIL PROTECTED]]
Hi, I am trying to use spring configured bean
by creating spring container inside skeleton generated by wsdl2java to create
my own implementation class for web service, but spring container BeanFactory
can't load my classes packaged inside axis2 aar file. I think this is related
to class loader aixs2 is using for each web service. Does anyone have sample
code to solve this problem? Shaowei
Mao aMind
Solutions LLC Phone:
425-313-3107 Email:
[EMAIL PROTECTED]
website:
www.amindsolutions.com |
- RE: [axis2] use spring configured bean inside axis2 as im... Dave Andreasen
- Re: [axis2] use spring configured bean inside axis2 ... Rajith Attapattu