You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2007/08/09 15:41:22 UTC

Contribution URLs

I've just noticed that if I have a contribution directory as follows

/my/contribution/dir/mycomposite.composite

And I pass the source URL /my/contribution/dir to the contribution service
it complains that it can't find /my/contribution/mycomposite.composite.
If I pass the source URL /my/contribution/dir/ it works (note slash on end).


Is this a fault?

Simon

Re: Contribution URLs

Posted by Simon Laws <si...@googlemail.com>.
On 8/10/07, Luciano Resende <lu...@gmail.com> wrote:
>
> I think your current directory, during the execution of the code, will
> not be mapped to the root of you project, but probably to
> target/classes or target/test-classes. Could you check that please ?
>
> On 8/10/07, Simon Laws <si...@googlemail.com> wrote:
> > On 8/9/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > Hi Simon,
> > >
> > >    Could you please send the exact URL you are passing to the
> > > contribution service ?
> > >
> > >    I have added a test case for what I understood your problem is, and
> > > that is working fine, but note that in the test case, I'm calling
> > > getClass().getResource("/deployables"), and that gives me a url like :
> > > file:/..../deployables, and that would pass the logic to correct
> > > identify a "folder".
> > >
> > > On 8/9/07, Simon Laws <si...@googlemail.com> wrote:
> > > > I've just noticed that if I have a contribution directory as follows
> > > >
> > > > /my/contribution/dir/mycomposite.composite
> > > >
> > > > And I pass the source URL /my/contribution/dir to the contribution
> > > service
> > > > it complains that it can't find
> /my/contribution/mycomposite.composite.
> > > > If I pass the source URL /my/contribution/dir/ it works (note slash
> on
> > > end).
> > > >
> > > >
> > > > Is this a fault?
> > > >
> > > > Simon
> > > >
> > >
> > >
> > > --
> > > Luciano Resende
> > > Apache Tuscany Committer
> > > http://people.apache.org/~lresende
> > > http://lresende.blogspot.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >
> > > Hi Luciano
> >
> > This was the piece of code that was causing me problems...
> >
> >             contributionURL = new URL("file:/" +
> > currentDirectory.getCanonicalPath() + "/src/main/resources/" + nodeName
> +
> > "/");
> >
> >             // Contribute the SCA application
> >             Contribution contribution = contributionService.contribute("
> > http://calculator",
> >
> contributionURL,
> >                                                           resolver,
> >                                                           false);
> >             Composite composite = contribution.getDeployables().get(0);
> >
> >             // Add the deployable composite to the domain
> >             domain.getDomainComposite().getIncludes().add(composite);
> >             domain.getCompositeBuilder().build(composite);
> >
> > Where the directory structure is.
> >
> > src/
> >    main/
> >       resources/
> >                nodeA/
> >                      META-INF/
> >                          sca-contribution.xml
> >                       wsdl
> >                          mutiply.wsdl
> >                       calculator.composite
> >
> > And I want to read the contribution from the nodeA directory.
> >
> > Maybe you can spot something from this. But if nothing comes to mind
> > immediately don't worry. I'll check this test in over the next few days
> and
> > we can look at it directly.
> >
> > Regards
> >
> > Simon
> >
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> currently I'm mapping it to root directory of my project, i.e the
directory that holds src. I could map it to test/classes as, of course,
maven copies the resources there also. Would that make a difference?

Simon

Re: Contribution URLs

Posted by Luciano Resende <lu...@gmail.com>.
I think your current directory, during the execution of the code, will
not be mapped to the root of you project, but probably to
target/classes or target/test-classes. Could you check that please ?

On 8/10/07, Simon Laws <si...@googlemail.com> wrote:
> On 8/9/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Hi Simon,
> >
> >    Could you please send the exact URL you are passing to the
> > contribution service ?
> >
> >    I have added a test case for what I understood your problem is, and
> > that is working fine, but note that in the test case, I'm calling
> > getClass().getResource("/deployables"), and that gives me a url like :
> > file:/..../deployables, and that would pass the logic to correct
> > identify a "folder".
> >
> > On 8/9/07, Simon Laws <si...@googlemail.com> wrote:
> > > I've just noticed that if I have a contribution directory as follows
> > >
> > > /my/contribution/dir/mycomposite.composite
> > >
> > > And I pass the source URL /my/contribution/dir to the contribution
> > service
> > > it complains that it can't find /my/contribution/mycomposite.composite.
> > > If I pass the source URL /my/contribution/dir/ it works (note slash on
> > end).
> > >
> > >
> > > Is this a fault?
> > >
> > > Simon
> > >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende
> > http://lresende.blogspot.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> > Hi Luciano
>
> This was the piece of code that was causing me problems...
>
>             contributionURL = new URL("file:/" +
> currentDirectory.getCanonicalPath() + "/src/main/resources/" + nodeName +
> "/");
>
>             // Contribute the SCA application
>             Contribution contribution = contributionService.contribute("
> http://calculator",
>                                                           contributionURL,
>                                                           resolver,
>                                                           false);
>             Composite composite = contribution.getDeployables().get(0);
>
>             // Add the deployable composite to the domain
>             domain.getDomainComposite().getIncludes().add(composite);
>             domain.getCompositeBuilder().build(composite);
>
> Where the directory structure is.
>
> src/
>    main/
>       resources/
>                nodeA/
>                      META-INF/
>                          sca-contribution.xml
>                       wsdl
>                          mutiply.wsdl
>                       calculator.composite
>
> And I want to read the contribution from the nodeA directory.
>
> Maybe you can spot something from this. But if nothing comes to mind
> immediately don't worry. I'll check this test in over the next few days and
> we can look at it directly.
>
> Regards
>
> Simon
>


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Contribution URLs

Posted by Giorgio Zoppi <gi...@gmail.com>.
On Fri, 2007-08-10 at 08:18 +0100, Simon Laws wrote:

> This was the piece of code that was causing me problems...
> 
>             contributionURL = new URL("file:/" +
> currentDirectory.getCanonicalPath() + "/src/main/resources/" + nodeName +
> "/");
> 
>             // Contribute the SCA application
>             Contribution contribution = contributionService.contribute("
> http://calculator",
>                                                           contributionURL,
>                                                           resolver,
>                                                           false);
>             Composite composite = contribution.getDeployables().get(0);
> 
>             // Add the deployable composite to the domain
>             domain.getDomainComposite().getIncludes().add(composite);
>             domain.getCompositeBuilder().build(composite);
On Linux you should write:
ContributionURL = new URL("file://" +
currentDirectory.getCanonicalPath() + "/src/main/resources/" + nodeName
+"/");
See my previous post.
Cheers,
Jo.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Contribution URLs

Posted by Simon Laws <si...@googlemail.com>.
On 8/9/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Hi Simon,
>
>    Could you please send the exact URL you are passing to the
> contribution service ?
>
>    I have added a test case for what I understood your problem is, and
> that is working fine, but note that in the test case, I'm calling
> getClass().getResource("/deployables"), and that gives me a url like :
> file:/..../deployables, and that would pass the logic to correct
> identify a "folder".
>
> On 8/9/07, Simon Laws <si...@googlemail.com> wrote:
> > I've just noticed that if I have a contribution directory as follows
> >
> > /my/contribution/dir/mycomposite.composite
> >
> > And I pass the source URL /my/contribution/dir to the contribution
> service
> > it complains that it can't find /my/contribution/mycomposite.composite.
> > If I pass the source URL /my/contribution/dir/ it works (note slash on
> end).
> >
> >
> > Is this a fault?
> >
> > Simon
> >
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
> Hi Luciano

This was the piece of code that was causing me problems...

            contributionURL = new URL("file:/" +
currentDirectory.getCanonicalPath() + "/src/main/resources/" + nodeName +
"/");

            // Contribute the SCA application
            Contribution contribution = contributionService.contribute("
http://calculator",
                                                          contributionURL,
                                                          resolver,
                                                          false);
            Composite composite = contribution.getDeployables().get(0);

            // Add the deployable composite to the domain
            domain.getDomainComposite().getIncludes().add(composite);
            domain.getCompositeBuilder().build(composite);

Where the directory structure is.

src/
   main/
      resources/
               nodeA/
                     META-INF/
                         sca-contribution.xml
                      wsdl
                         mutiply.wsdl
                      calculator.composite

And I want to read the contribution from the nodeA directory.

Maybe you can spot something from this. But if nothing comes to mind
immediately don't worry. I'll check this test in over the next few days and
we can look at it directly.

Regards

Simon

Re: Contribution URLs

Posted by Luciano Resende <lu...@gmail.com>.
Hi Simon,

   Could you please send the exact URL you are passing to the
contribution service ?

   I have added a test case for what I understood your problem is, and
that is working fine, but note that in the test case, I'm calling
getClass().getResource("/deployables"), and that gives me a url like :
file:/..../deployables, and that would pass the logic to correct
identify a "folder".

On 8/9/07, Simon Laws <si...@googlemail.com> wrote:
> I've just noticed that if I have a contribution directory as follows
>
> /my/contribution/dir/mycomposite.composite
>
> And I pass the source URL /my/contribution/dir to the contribution service
> it complains that it can't find /my/contribution/mycomposite.composite.
> If I pass the source URL /my/contribution/dir/ it works (note slash on end).
>
>
> Is this a fault?
>
> Simon
>


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org