On Wed, Mar 3, 2010 at 12:07 AM, Luciano Resende <[email protected]>wrote:

> On Tue, Mar 2, 2010 at 3:41 PM, Wayne Keenan <[email protected]>
> wrote:
> >
> > Hi,
> >
> > I am using Tuscany 1.6 and am trying to get start all composites on the
> > classpath to start using the no-arg newInstance() method of the
> SCADomain;
> > the probem is only the 1st (w.r.t. classpath ordering) is ever started.
> > 'main' is basically just:
> >
>
> >
> > If I reorder the classpath to be  dirB/*...:dirA/*...   then B will start
> > and not A.
> >
> > Please could someone help me understand if there is something missing in
> > what I am doing?  or if what I am doing is just wrong?
> >
>
> Just from a quick look, it seems we are looking for artifacts that
> starts with META-INF/sca-deployables
>
>  // Add all composites under META-INF/sca-deployables to the
>        // list of deployables
>        String prefix = Contribution.SCA_CONTRIBUTION_DEPLOYABLES;
>        for (Artifact artifact : contribution.getArtifacts()) {
>            if (artifact.getModel() instanceof Composite) {
>                if (artifact.getURI().startsWith(prefix)) {
>                    Composite composite = (Composite)artifact.getModel();
>                    if (!contribution.getDeployables().contains(composite))
> {
>                        contribution.getDeployables().add(composite);
>                    }
>                }
>            }
>        }
>
> From your folder structure, it seems that you have dirA and dirB which
> will fail this... or maybe it seems that you are trying to contribute
> two contributions and then what I'm saying would not apply...
>

Thanks for looking at the code, I tried but got lost at this late hour.

I think the paths are ok because if the classpath is dirA:dirB,   then A is
started, B is not;  and if the classpath is dirB:dirA,   then B is started,
A is not.

So is the Tuscany classpath search unlike Springs recursive classpath*:
search and will only look in the 1st  META-INF/sca-deployables found?



> Could you post the initialization code around the SCADomain ? Also,
> could you try adding a sca-contribution.xml to see if that workaround
> the issue you are having.
>
>

    public static void main(String[] args) {
        try {

            org.apache.tuscany.sca.host.embedded.SCADomain.newInstance();

            new CountDownLatch(1).await();

        } catch (Exception ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null,
ex);
        }
    }

Thanks
Wayne


> --
> Luciano Resende
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/
>

Reply via email to