Return-Path: Delivered-To: apmail-tuscany-user-archive@www.apache.org Received: (qmail 70379 invoked from network); 5 Apr 2011 14:48:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2011 14:48:30 -0000 Received: (qmail 81149 invoked by uid 500); 5 Apr 2011 14:48:29 -0000 Delivered-To: apmail-tuscany-user-archive@tuscany.apache.org Received: (qmail 81120 invoked by uid 500); 5 Apr 2011 14:48:29 -0000 Mailing-List: contact user-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@tuscany.apache.org Delivered-To: mailing list user@tuscany.apache.org Received: (qmail 81113 invoked by uid 99); 5 Apr 2011 14:48:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 14:48:29 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of monosij.forums@gmail.com designates 209.85.214.53 as permitted sender) Received: from [209.85.214.53] (HELO mail-bw0-f53.google.com) (209.85.214.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 14:48:22 +0000 Received: by bwg12 with SMTP id 12so432402bwg.26 for ; Tue, 05 Apr 2011 07:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ahoY/8gZ1hsnrUPaYKTkJ+eFHPR1nUjPu2BWDd43oUA=; b=usdPfaWjwvXse6DLbTEJYWfJ7XDz3NnX4+5ZZj1ns7BnpD4zwu5BgRCVXbT1hMRgGo CvXn8bsSygZBK83WSGIoWECLnDNregcRfGQJvMQi1PBelSB0FINx8DXMxbUBcdDAFTL9 FH6AcXzCMD4YQF8l8RidcVEINtmtOslx1eenk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=oB3+uuZ+kRWFFLm5WaAT/MD+rQIXn9sWKP29vgsBBqYvQbr0hDLdnnDiwpFHx1j6vl tebfJFFNSwkWri2gWf1GM8bnlL9SaIQMtVZo1qqd5XIuCCGvJP4lwsfPLsiu1eM5L5sL wu2mcHvabrGrrHLmsAq4DoarKbEsUtOUVvfKE= MIME-Version: 1.0 Received: by 10.204.23.197 with SMTP id s5mr1468618bkb.81.1302014880847; Tue, 05 Apr 2011 07:48:00 -0700 (PDT) Received: by 10.204.50.67 with HTTP; Tue, 5 Apr 2011 07:48:00 -0700 (PDT) In-Reply-To: References: <4D98838D.5050906@apache.org> <103B1728-5B45-462F-81D7-744BD678188D@gmail.com> Date: Tue, 5 Apr 2011 10:48:00 -0400 Message-ID: Subject: Re: Webapp Configuration: with multiple Contribution / Composites From: Monosij Dutta-Roy To: antelder@apache.org Cc: user@tuscany.apache.org Content-Type: multipart/alternative; boundary=000325556dee77264d04a02cf618 X-Virus-Checked: Checked by ClamAV on apache.org --000325556dee77264d04a02cf618 Content-Type: text/plain; charset=UTF-8 Ok great. Let me see where I go with this setup. I will use Beta2. Also for AOP issues then I would use Tuscany's AOP framework rather than Spring's even within the webapp layer. Will that work. In asking this question I have to say I have a basic understanding of how AOP works not in depth. Thanks.. monosij On Tue, Apr 5, 2011 at 3:31 AM, ant elder wrote: > Yes exactly. I think thats an approach which fits in very well with > SCA and web applications. > > One note, is that 2.0-Beta2 is the current latest release so thats > what you should move up to not M5 which is a little older now. > > ...ant > > On Tue, Apr 5, 2011 at 3:36 AM, Monosij Dutta-Roy > wrote: > > hi Simon, AntElder - > > Thanks for your responses. I will take a couple of days and reconfigure > it > > the way you mention with Tuscany 2.0 M5 and not M4. > > I also wanted to ask - is this a 'proper' architectural approach in > > developing a webapp? > > My reasoning is - this approach could help me swap out the interface > layer > > (the webapp part of it) - with say Spring MVC or Struts or Guice and > such. > > And allow scaling of the other composites (components) across one or more > > nodes. > > Once i get this webapp going I would like to approach it from a Spring > MVC > > webapp perspective and keep the other composites as they are. > > Just wondering if you think that - that is a good approach - or should I > be > > considering scaling and such from a different approach. > > Thanks. > > monosij > > > > On Mon, Apr 4, 2011 at 3:20 PM, ant elder wrote: > >> > >> On Mon, Apr 4, 2011 at 6:00 PM, Monosij Dutta-Roy > >> wrote: > >> > hi Raymond > >> > Thanks for your response. I don't know if you got those composites > from > >> > the > >> > war but here are my 3 composites attached. > >> > I think the references are ok. I did make sure they are. > >> > It is not the same as you show below - which means maybe there is > maven > >> > packaging issue? > >> > The dependency is as follows: qmWebApp > qmController > entitBCA. > >> > I did a mvn clean - and mvn package - before a mvn jetty:run > >> > And to answer your ques - I have (as far as I understand) 1 web app - > >> > with 2 > >> > dependent components. > >> > Yes they are to the same Jetty (under Maven). > >> > Hope that helps. > >> > I will be taking a look at the war file again and the composites in it > >> > when > >> > I get back later today. > >> > Thanks a lot. > >> > monosij > >> > > >> > On Mon, Apr 4, 2011 at 12:24 PM, Raymond Feng > >> > wrote: > >> >> > >> >> By looking at the web.composite file you have: > >> >> >> >> xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" > >> >> targetNamespace="http://com.bca.app" > >> >> name="qmApp"> > >> >> > >> >> > >> >> > >> >> >> >> class="com.bca.pearl.app.QueryServiceImpl"/> > >> >> > >> >> > >> >> There are two issues: > >> >> 1) The target attribute doesn't match the component name (red) > >> >> 2) There is no reference under QueryService component > >> >> to QueryControllerComponent > >> >> Thanks, > >> >> Raymond > >> >> ________________________________________________________________ > >> >> Raymond Feng > >> >> rfeng@apache.org > >> >> Apache Tuscany PMC member and committer: tuscany.apache.org > >> >> Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com > >> >> Personal Web Site: www.enjoyjava.com > >> >> ________________________________________________________________ > >> >> On Apr 4, 2011, at 8:33 AM, Monosij Dutta-Roy wrote: > >> >> > >> >> As requested here are the attached files. > >> >> > >> >> Thanks for taking a look at my war. Its attached along with the three > >> >> composites and two contributions. > >> >> It contains the dependent jars: entityBCA and qmController. > >> >> The errors I get is in the earlier part of the thread. > >> >> I am trying to create a basic db search app with three components. > >> >> So the structure is as follows: > >> >> ---------- > >> >> entityBCA - domain.composite - sca-contribution.xml - pom.xml > >> >> has domain objects such as patients, addresses. > >> >> qmController - querycontroller.composite - sca-contribution.xml - > >> >> pom.xml > >> >> a search controller that has a searchComposer and searchExecutor. > >> >> qmApp - web.composite - no sca-contribution.xml > >> >> the webapp which passes the query to qmController > >> >> ---------- > >> >> What I was trying to figure out is - as you show in the examples - > >> >> client > >> >> do the entityBCA and qmController need to be loaded as nodes? Or > does > >> >> Tuscany within Jetty already do it? > >> >> My goal is to keep the webapp framework - jsp / jsf and such > completely > >> >> separate from the core components such that the front end > technologies > >> >> can > >> >> be changed while configuring the other components to be run in a > >> >> distributed > >> >> environment. > >> >> ---------- > >> >> My background is Java / C++ and somewhat new to the JEE frameworks > such > >> >> as > >> >> Tuscany, Maven and such - so XML configs is a little new to me. > >> >> Thanks a lot! > >> >> monosij > >> >> > >> >> On Sun, Apr 3, 2011 at 10:26 AM, Simon Nash wrote: > >> >>> > >> >>> Monosij Dutta-Roy wrote: > >> >>>> > >> >>>> New to Tuscany and following SCA in Action. Have a question on a > >> >>>> webapp > >> >>>> I created using the Maven tasks. > >> >>>> The webapp works fine as a single composite - broken up by several > >> >>>> components. > >> >>>> ------------------------ > >> >>>> However when I create several composites (different contributions > >> >>>> using > >> >>>> Maven tasks) and wire them together - again webapp compiles and > sets > >> >>>> up in > >> >>>> Jetty fine. When I hit a component that has a reference in a > separate > >> >>>> composite I get an error as below: > >> >>>> ------------------------ > >> >>>> Problem accessing /qmApp/. Reason: > >> >>>> org.oasisopen.sca.SCARuntimeException: Unable to bind > >> >>>> (@31214809)EndpointReference: URI = > >> >>>> QueryServiceComponent#reference(queryController) > >> >>>> WIRED_TARGET_NOT_FOUND > >> >>>> Target = (@3751575)Endpoint: URI = > >> >>>> QueryController#service(QueryControllerService) [Unresolved] > >> >>>> > >> >>>> The QueryController/QueryControllerService is setup as a reference. > >> >>>> ------------------------ > >> >>>> Its a small app and I have looked at the configs in detail and > think > >> >>>> they are correct. Of course Maven compiles all of them fine - and > as > >> >>>> I said > >> >>>> deploys fine as well. > >> >>>> > >> >>>> However I am not sure I am loading the QueryController (the other > >> >>>> contribution/composite/reference - setup as a service) properly. I > >> >>>> have > >> >>>> checked the composite file quite thoroughly and relevant code. I > can > >> >>>> upload > >> >>>> them if needed. > >> >>>> ------------------------ > >> >>>> I assume when the war is build all the dependent jars are packaged > in > >> >>>> by > >> >>>> Maven and when Jetty starts the Tuscany API sorts out the > >> >>>> dependencies? Or > >> >>>> is there anything else I need to do for this quite simple setup? > But > >> >>>> a setup > >> >>>> that involves a webapp with different contributions. > >> >>>> > >> >>>> The reason I ask is also because the webapp generated by Maven does > >> >>>> not > >> >>>> have a sca-contribution.xml file where I import / export other > >> >>>> packages. > >> >>>> ------------------------ > >> >>>> Thanks. > >> >>>> > >> >>> It would be very useful if you could upload the failing war file. > >> >>> This > >> >>> might provide some important clues to the cause of the problem. > >> >>> > >> >>> Simon > >> >>> > >> >> > >> >> > >> >> > >> >> > >> >> > > >> > > >> > > >> > >> Hi monosij, > >> > >> I don't think Tuscany 1.x or 2.0-M4 supported multiple SCA > >> contribution within the WEB-INF/lib folder, there may be a way I'm not > >> remembering but I don't think so. If you put SCA contributions jars > >> into WEB-INF/lib they are just treated as regular jars not SCA > >> contributions and any .composite or sca-contribution.xml files within > >> are ignored. > >> > >> There is a way to do this since 2.0-M5 by putting the contributions > >> into a folder name WEB-INF/sca-contributions. There is a sample which > >> demonstrates this that we have just added to the trunk samples, so its > >> pom.xml shows what you need to do, see > >> > >> > https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-webapp/ > >> > >> Note that when you update to the later Tuscany 2.x releases that the > >> SCA namespace changed so you will need to update your contributions. > >> The change is in your .composite and sca-contribution.xml files should > >> have xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" - note > >> 12 at the end instead of the 03 that 2.0-M4 used. > >> > >> Give it a try with the latest Tuscany release - 2.0-Beta2 - and let us > >> know how you get on. > >> > >> ...ant > > > > > --000325556dee77264d04a02cf618 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ok great. Let me see where I go with this setup. I will use Beta2.

=
Also for AOP issues then I would use Tuscany's AOP framework= rather than Spring's even within the webapp layer. Will that work.=C2= =A0
In asking this question I have to say I have a basic understanding of = how AOP works not in depth.

Thanks..
monosij

On Tue, Apr 5, 2011 a= t 3:31 AM, ant elder <antelder@apache.org> wrote:
Yes exactly. I think thats an approach whic= h fits in very well with
SCA and web applications.

One note, is that 2.0-Beta2 is the current latest release so thats
what you should move up to not M5 which is a little older now.

=C2=A0 ...ant

On Tue, Apr 5, 2011 at 3:36 AM, Monosij Dutta-Roy
<monosij.forums@gmail.com> wrote:
> hi Simon, AntElder -
> Thanks for your responses. I will take a couple of days and reconfigur= e it
> the way you mention with Tuscany 2.0 M5 and not M4.
> I also wanted to ask - is this a 'proper'=C2=A0architectural= =C2=A0approach in
> developing a webapp?
> My reasoning is - this approach could help me swap out the interface l= ayer
> (the webapp part of it) - with say Spring MVC or Struts or Guice and s= uch.
> And allow=C2=A0scaling=C2=A0of the other composites (components) acros= s one or more
> nodes.
> Once i get this webapp going I would like to approach it from a Spring= MVC
> webapp perspective and keep the other composites as they are.
> Just wondering if you think that - that is a good approach - or should= I be
> considering scaling and such from a different approach.
> Thanks.
> monosij
>
> On Mon, Apr 4, 2011 at 3:20 PM, ant elder <ant.elder@gmail.com> wrote:
>>
>> On Mon, Apr 4, 2011 at 6:00 PM, Monosij Dutta-Roy
>> <monosij.forums@gma= il.com> wrote:
>> > hi Raymond
>> > Thanks for your response. I don't know if you got those c= omposites from
>> > the
>> > war but here are my 3 composites attached.
>> > I think the references are ok. I did make sure they are.
>> > It is not the same as you show below - which means maybe ther= e is maven
>> > packaging issue?
>> > The dependency is as follows: qmWebApp > qmController >= entitBCA.
>> > I did a mvn clean - and mvn package - before a mvn jetty:run<= br> >> > And to answer your ques - I have (as far as I understand) 1 w= eb app -
>> > with 2
>> > dependent components.
>> > Yes they are to the same Jetty (under Maven).
>> > Hope that helps.
>> > I will be taking a look at the war file again and the composi= tes in it
>> > when
>> > I get back later today.
>> > Thanks a lot.
>> > monosij
>> >
>> > On Mon, Apr 4, 2011 at 12:24 PM, Raymond Feng <enjoyjava@gmail.com>
>> > wrote:
>> >>
>> >> By looking at the web.composite file you have:
>> >> <composite xmlns=3D"http://docs.oasis-open.or= g/ns/opencsa/sca/200903"
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 xmlns:tuscany=3D= "http://tuscany.apache.org/xmlns/sca/1.1"
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 targetNamespace= =3D"http://com.bca.ap= p"
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name=3D"qmA= pp">
>> >> =C2=A0=C2=A0 =C2=A0<!-- component name=3D"qmAppWe= bComponent">
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0<implementation.web w= eb-uri=3D""/>
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0<reference name=3D&qu= ot;service" target=3D"QueryServiceComponent"/>
>> >> =C2=A0=C2=A0 =C2=A0</component>
>> >> =C2=A0=C2=A0 =C2=A0<component name=3D"QueryContro= llerComponent">
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0<implementation.java = class=3D"com.bca.qm.QueryControllerImpl"/-->
>> >> =C2=A0=C2=A0 =C2=A0</component>
>> >> =C2=A0=C2=A0 =C2=A0<component name=3D"QueryServic= e">
>> >> =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0<implementation.java<= br> >> >> class=3D"com.bca.pearl.app.QueryServiceImpl"/&g= t;
>> >> =C2=A0=C2=A0 =C2=A0</component>
>> >> </composite>
>> >> There are two issues:
>> >> 1) The target attribute doesn't match the component n= ame (red)
>> >> 2) There is no reference under QueryService component
>> >> to=C2=A0QueryControllerComponent
>> >> Thanks,
>> >> Raymond
>> >> _________________________________________________________= _______
>> >> Raymond Feng
>> >> rfeng@apache.org<= br> >> >> Apache Tuscany PMC member and committer: tuscany.apache.org
>> >> Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com >> >> Personal Web Site: www.enjoyjava.com
>> >> _________________________________________________________= _______
>> >> On Apr 4, 2011, at 8:33 AM, Monosij Dutta-Roy wrote:
>> >>
>> >> As requested here are the attached files.
>> >>
>> >> Thanks for taking a look at my war. Its attached along wi= th the three
>> >> composites and two contributions.
>> >> It contains the dependent jars: entityBCA and qmControlle= r.
>> >> The errors I get is in the earlier part of the thread. >> >> I am trying to create a basic db search app with three co= mponents.
>> >> So the structure is as follows:
>> >> ----------
>> >> entityBCA - domain.composite -=C2=A0sca-contribution.xml = - pom.xml
>> >> has domain objects such as patients, addresses.
>> >> qmController - querycontroller.composite -=C2=A0sca-contr= ibution.xml -
>> >> pom.xml
>> >> a search controller that has a searchComposer and searchE= xecutor.
>> >> qmApp - web.composite -=C2=A0no sca-contribution.xml
>> >> the webapp which passes the query to qmController
>> >> ----------
>> >> What I was trying to figure out is - as you show in the e= xamples -
>> >> client
>> >> do the entityBCA and qmController need to be loaded as no= des? =C2=A0Or does
>> >> Tuscany within Jetty already do it?
>> >> My goal is to keep the webapp framework - jsp / jsf and s= uch completely
>> >> separate from the core components such that the front end= technologies
>> >> can
>> >> be changed while configuring the other components to be r= un in a
>> >> distributed
>> >> environment.
>> >> ----------
>> >> My background is Java / C++ and somewhat new to the JEE f= rameworks such
>> >> as
>> >> Tuscany, Maven and such=C2=A0- so XML configs is a little= new to me.
>> >> Thanks a lot!
>> >> monosij
>> >>
>> >> On Sun, Apr 3, 2011 at 10:26 AM, Simon Nash <nash@apache.org> wrote:
>> >>>
>> >>> Monosij Dutta-Roy wrote:
>> >>>>
>> >>>> New to Tuscany and following SCA in Action. Have = a question on a
>> >>>> webapp
>> >>>> I created using the Maven tasks.
>> >>>> The webapp works fine as a single composite - bro= ken up by several
>> >>>> components.
>> >>>> ------------------------
>> >>>> However when I create several composites (differe= nt contributions
>> >>>> using
>> >>>> Maven tasks) and wire them together - again webap= p compiles and sets
>> >>>> up in
>> >>>> Jetty fine. When I hit a component that has a ref= erence in a separate
>> >>>> composite I get an error as below:
>> >>>> ------------------------
>> >>>> Problem accessing /qmApp/. Reason:
>> >>>> =C2=A0 =C2=A0org.oasisopen.sca.SCARuntimeExceptio= n: Unable to bind
>> >>>> (@31214809)EndpointReference: =C2=A0URI =3D
>> >>>> QueryServiceComponent#reference(queryController)<= br> >> >>>> WIRED_TARGET_NOT_FOUND
>> >>>> =C2=A0Target =3D (@3751575)Endpoint: =C2=A0URI = =3D
>> >>>> QueryController#service(QueryControllerService) [= Unresolved]
>> >>>>
>> >>>> The QueryController/QueryControllerService is set= up as a reference.
>> >>>> ------------------------
>> >>>> Its a small app and I have looked at the configs = in detail and think
>> >>>> they are correct. Of course Maven compiles all of= them fine - and as
>> >>>> I said
>> >>>> deploys fine as well.
>> >>>>
>> >>>> However I am not sure I am loading the QueryContr= oller (the other
>> >>>> contribution/composite/reference - setup as a ser= vice) properly. I
>> >>>> have
>> >>>> checked the composite file quite thoroughly and r= elevant code. I can
>> >>>> upload
>> >>>> them if needed.
>> >>>> ------------------------
>> >>>> I assume when the war is build all the dependent = jars are packaged in
>> >>>> by
>> >>>> Maven and when Jetty starts the Tuscany API sorts= out the
>> >>>> dependencies? Or
>> >>>> is there anything else I need to do for this quit= e simple setup? But
>> >>>> a setup
>> >>>> that involves a webapp with different contributio= ns.
>> >>>>
>> >>>> The reason I ask is also because the webapp gener= ated by Maven does
>> >>>> not
>> >>>> have a sca-contribution.xml file where I import /= export other
>> >>>> packages.
>> >>>> ------------------------
>> >>>> Thanks.
>> >>>>
>> >>> It would be very useful if you could upload the faili= ng war file.
>> >>> =C2=A0This
>> >>> might provide some important clues to the cause of th= e problem.
>> >>>
>> >>> =C2=A0Simon
>> >>>
>> >>
>> >>
>> >>
>> >>
>> >> <qmApp-1.0-SNAPSHOT.war><qmApp-1.0-SNAPSHOT.pom&= gt;<entityBCA-1.0-SNAPSHOT.pom><qmController-1.0-SNAPSHOT.pom><= br> >> >
>> >
>>
>> Hi monosij,
>>
>> I don't think Tuscany 1.x or 2.0-M4 supported multiple SCA
>> contribution within the WEB-INF/lib folder, there may be a way I&#= 39;m not
>> remembering but I don't think so. If you put SCA contributions= jars
>> into WEB-INF/lib they are just treated as regular jars not SCA
>> contributions and any .composite or sca-contribution.xml files wit= hin
>> are ignored.
>>
>> There is a way to do this since 2.0-M5 by putting the contribution= s
>> into a folder name WEB-INF/sca-contributions. There is a sample wh= ich
>> demonstrates this that we have just added to the trunk samples, so= its
>> pom.xml shows what you need to do, see
>>
>> https://= svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/getting-started= /helloworld-webapp/
>>
>> Note that when you update to the later Tuscany 2.x releases that t= he
>> SCA namespace changed so you will need to update your contribution= s.
>> The change is in your .composite and sca-contribution.xml files sh= ould
>> have xmlns=3D"http://docs.oasis-open.org/ns/opencsa/sca/2= 00912" - note
>> 12 at the end instead of the 03 that 2.0-M4 used.
>>
>> Give it a try with the latest Tuscany release - 2.0-Beta2 - and le= t us
>> know how you get on.
>>
>> =C2=A0 ...ant
>
>

--000325556dee77264d04a02cf618--