axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Tomasini" <ben.tomas...@gmail.com>
Subject Re: Axis2 Spring Question
Date Sun, 12 Aug 2007 22:02:07 GMT
Here is the link:

http://bentomasini.com/blog/2007/07/22/a-simple-approach-to-axis2/

Ben

On 8/12/07, Ben Tomasini <ben.tomasini@gmail.com> wrote:
>
> I take this a bit further and simply skip the creation of an aar file.  I
> put all of my definitions in a single services.xml (using service-group)
> file in WEB-INF/services/WebService/META-INF/services.xml.  There is a full
> example on my website.
>
> Ben
>
> On 8/12/07, robert lazarski <robertlazarski@gmail.com> wrote:
> >
> > If you run into classloader issues at the web app level, all you
> > really need to do is just have an aar with its services.xml and
> > perhaps wsdl's and xsd's - and move all the classes to be under
> > WEB-INF/lib and WEB-INF/classes.
> >
> > HTH,
> > Robert
> >
> > On 8/12/07, John Pfeifer <john.pfeifer@hnpsolutions.com> wrote:
> > > Robert
> > >
> > > I was able to get a bean using the appcontextholder.  The problem was
> > when I imported the class for that bean in my servlet I got a
> > noclassdeffound error.  If I treated the bean as object it worked.
> > >
> > > Thanks
> > > John
> > >
> > >
> > > -----Original Message-----
> > > From: "robert lazarski" < robertlazarski@gmail.com>
> > > To: " axis-user@ws.apache.org" < axis-user@ws.apache.org>
> > > Sent: 8/12/07 4:38 PM
> > > Subject: Re: Axis2 Spring Question
> > >
> > > Try using the bean I showed you - that'll work inside or outside the
> > aar.
> > >
> > > Robert
> > >
> > > On 8/12/07, John Pfeifer < john.pfeifer@hnpsolutions.com > wrote:
> > > >
> > > >
> > > >
> > > > Robert,
> > > >
> > > >  My original configuration was an aar file with all of it's
> > libraries inside
> > > > the lib directory of the aar file.  In addition, I was running
> > spring within
> > > > the aar file using a SpringInit class.  This worked very well, but
> > now I
> > > > need to package some servlets in the same war file as my axis2.war(which
> > > > contains my aar).  These servlets need access to beans defined
> > within the
> > > > spring context which is inside the aar file.
> > > >
> > > >  Since the servlets are loaded by the webapp classloader and the
> > axis2
> > > > deployment classloader is a child of the webapp, it seems that my
> > servlets
> > > > won't have access to the classes (and subsequently the beans that
> > are
> > > > created) inside the aar file.  I tried this and it didn't work for
> > the
> > > > reasons mentioned above.  I then tried moving all librares from the
> > aar file
> > > > to the WEB-INF/lib directory which includes the spring.jarfile.  This
got
> > > > me a little bit closer, but I still have the same issues.  My
> > servlets still
> > > > depend on classes that reside inside the aar and are unable to load
> > them
> > > > when the container starts up.  I am afraid that my only solution is
> > to move
> > > > these common classes into a different jar and put that in the
> > WEB-INF/lib
> > > > directory.  So in essence, I don't see a way for servlets to
> > reference any
> > > > classes that are loaded from within the aar file.
> > > >
> > > >  With that being said, I am open to suggestions.  Also, it's quite
> > possible
> > > > that I am doing something wrong.  Any help would be greatly
> > appreciated.
> > > >
> > > >  Thanks,
> > > >
> > > >  John
> > > >
> > > >
> > > >  -----Original Message-----
> > > >  From: robert lazarski [mailto: robertlazarski@gmail.com]
> > > >  Sent: Sat 8/11/2007 8:34 AM
> > > >  To: axis-user@ws.apache.org
> > > >  Subject: Re: Axis2 Spring Question
> > > >
> > > >  If I understand you correctly, you just need to get a hold of your
> > > >  beans anytime, anywhere. If you are doing Spring inside the AAR,
> > you
> > > >  already defined 'bean id="applicationContext"' . If not, you can
> > still
> > > >  make use of it. At the web-app level , axis2 uses that bean to get
> > its
> > > >  spring beans to make a Service out of it. This all takes advantage
> > of
> > > >  the Spring's ApplicationContextAware interface. Its perfectly fine
> > for
> > > >  you to use the static method that Axis2's internals use also:
> > > >
> > > >
> > http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java?view=markup
> > > >
> > > >  Here's some javadoc:
> > > >
> > > > http://ws.apache.org/axis2/1_2/api/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.html
> >
> > > > http://www.springframework.org/docs/api/org/springframework/beans/factory/BeanFactory.html#getBean(java.lang.String)
> >
> > <http://www.springframework.org/docs/api/org/springframework/beans/factory/BeanFactory.html#getBean%28java.lang.String%29>
> > > >
> > > >  HTH,
> > > >  Robert
> > > >
> > > >  On 8/10/07, John Pfeifer < john.pfeifer@hnpsolutions.com> wrote:
> > > >  >
> > > >  >
> > > >  >
> > > >  >
> > > >  > I currently have my web services running with axis2 (1.1) and
> > spring
> > > > running
> > > >  > inside the aar.  Recently I have discovered a need for servlets
> > and/or
> > > > web
> > > >  > pages to get access to the objects that are in the spring
> > context.  If I
> > > >  > move spring to the WEB-INF/lib, can I do this?  The Axis2-Spring
> > > > integration
> > > >  > docs don't go into much detail here.  I guess what I am wondering
> > is
> > > > whether
> > > >  > or not the aar files are available at the time the Spring
> > > >  > ContextLoaderListener starts up.  If so, this should work.
> > > >  >
> > > >  >  Thanks,
> > > >  >
> > > >  >  John
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > >  To unsubscribe, e-mail:
> > > > axis-user-unsubscribe@ws.apache.org
> > > >  For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>

Mime
View raw message