Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 47308 invoked from network); 4 Aug 2006 12:42:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Aug 2006 12:42:25 -0000 Received: (qmail 78931 invoked by uid 500); 4 Aug 2006 12:42:17 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 78691 invoked by uid 500); 4 Aug 2006 12:42:16 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 78680 invoked by uid 99); 4 Aug 2006 12:42:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 05:42:16 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of rajith77@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 05:42:14 -0700 Received: by nf-out-0910.google.com with SMTP id a4so94886nfc for ; Fri, 04 Aug 2006 05:41:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=VPtBtT3fwODIIWuiF9udF9I7jfCvdIMMgrBl4dZSyf6m9W4pkHlq25mvyYgZt898uE/M9fwc0gOr/MQwjOQgSsOQ871F9gYi72+WrwTUAoBGjJIZiYxhhv0bcRcFekj6+mALLbarBSeb0TScdyROIj187t7ubFLKczhgGcRbYbo= Received: by 10.78.133.10 with SMTP id g10mr1510888hud; Fri, 04 Aug 2006 05:41:52 -0700 (PDT) Received: by 10.78.193.8 with HTTP; Fri, 4 Aug 2006 05:41:52 -0700 (PDT) Message-ID: Date: Fri, 4 Aug 2006 08:41:52 -0400 From: "Rajith Attapattu" To: axis-user@ws.apache.org, davea@knetica.com Subject: Re: [axis2] use spring configured bean inside axis2 as implementation class In-Reply-To: <01d301c6b6ef$62f525f0$4b64a8c0@deerpark> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7144_26123716.1154695312810" References: <01d301c6b6ef$62f525f0$4b64a8c0@deerpark> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_7144_26123716.1154695312810 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Anderson, Thanks for the feedback and I definitely appreciate it. Once you are free please try out the fix by Dims to the class loading issue. I guess that will take care of the main concern you have. Also you don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support. also please see my comments inline. Regards, Rajith On 8/3/06, Dave Andreasen < davea@knetica.com> wrote: > > 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. > [RA] You don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support. You could still have the WebService that calls your core spring beans (which implements the business logic) as Spring beans. So you are not directly exposing your business logic, but still you are using spring to wire your web service with the spring beans that implement the business logic. For example public class MyWebService { private MyGreeting myGreeting; // let spring inject the dependency public void setMyGreeting(myGreeting){ this.myGreeting = myGreeting; } public String greet(String name){ return myGreeting.greetAccordingToTheTimeOfDay(name); } } //your business logic public class MyGreetingImpl implements MyGreeting{ public String greetAccordingToTheTimeOfDay(String name){ // if morning return "Good morning " + name: .... } public String greetWithLove(String name){ // ..... } } 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 AAR just > contains the Web Service skeletons. > > > > 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:rajith77@gmail.com] > *Sent:* Tuesday, August 01, 2006 7:50 PM > *To:* axis-user@ws.apache.org; davea@knetica.com > *Subject:* Re: [axis2] use spring configured bean inside axis2 as > implementation class > > > > Anderson , > > >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. > > Anderson if you don't mind I would like to hear about your use case about > the spring bean creation. Perhaps we can improve our spring support based on > your feedback. > > Regards, > > Rajith > > On 7/31/06, *Dave Andreasen* 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: smao@amindsolutions.com] > *Sent:* Monday, July 31, 2006 2:59 PM > *To:* axis-user@ws.apache.org > *Subject:* [axis2] use spring configured bean inside axis2 as > implementation class > > > > 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: smao@amindsolutions.com > > website: www.amindsolutions.com > > > > > ------=_Part_7144_26123716.1154695312810 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi Anderson,

Thanks for the feedback and I definitely appreciate it.
Once you are free please try out the fix by Dims to the class loading issue.
I guess that will take care of the main concern you have.
 
Also you don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support.

also please see my comments inline.
 
Regards,
 
Rajith
 
On 8/3/06, Dave Andreasen < davea@knetica.com > wrote:

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.

[RA] You don't have to expose your spring beans (the ones that implement the business logic) directly to leverage the spring support.

You could still have the WebService that calls your core spring beans (which implements the business logic) as Spring beans. So you are not directly exposing your business logic, but still you are using spring to wire your web service with the spring beans that implement the business logic.

For example

public class MyWebService {

      private MyGreeting myGreeting;
     
      // let spring inject the dependency      
      public void setMyGreeting(myGreeting){
          this.myGreeting = myGreeting;
      }

      public String greet(String name){
           return myGreeting.greetAccordingToTheTimeOfDay(name);
      }
}

//your business logic
public class MyGreetingImpl implements MyGreeting{

    public  String greetAccordingToTheTimeOfDay(String name){
        // if morning
           return "Good morning " + name:
       ....
    } 

    public String greetWithLove(String name){
       // .....
   }

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 AAR just contains the Web Service skeletons.

 

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: rajith77@gmail.com]
Sent: Tuesday, August 01, 2006 7:50 PM
To: axis-user@ws.apache.org; davea@knetica.com
Subject: Re: [axis2] use spring configured bean inside axis2 as implementation class

 

Anderson ,

>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.


Anderson if you don't mind I would like to hear about your use case about the spring bean creation. Perhaps we can improve our spring support based on your feedback.

Regards,

Rajith

On 7/31/06, Dave Andreasen < davea@knetica.com> 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: smao@amindsolutions.com]
Sent: Monday, July 31, 2006 2:59 PM
To: axis-user@ws.apache.org
Subject: [axis2] use spring configured bean inside axis2 as implementation class

 

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: smao@amindsolutions.com

website: www.amindsolutions.com

 

 


------=_Part_7144_26123716.1154695312810--