Sorry, the ServiceDeclaration.toString() doesn't contain the location URL of the file. I'll fix that.

Can you try to print out definitionsDeclaration.getLocation() instead?

Thanks,
Raymond
--------------------------------------------------
From: "Jean-Sebastien Delfino" <[email protected]>
Sent: Monday, October 12, 2009 9:51 AM
To: <[email protected]>
Subject: Re: [2.x] Test cases fail with DuplicateIntent errors in Eclipse

Raymond Feng wrote:
Hi,

Can you print out the ServiceDeclarations in the same class? It will tell the URL of the service provider configuration files.

       // Find each definitions
for (ServiceDeclaration definitionsDeclaration : definitionsDeclarations) { URL url = definitionsDeclaration.getResource(definitionsDeclaration.getClassName());
           if (url == null) {
throw new IllegalArgumentException(definitionsDeclaration.getClassName() + " cannot be found");
           }
           documents.add(url);
       }
[...]

I added:
System.out.println("### " + definitionsDeclaration);

and I get:

### ClassLoader: sun.misc.launcher$appclassloa...@4c6c4c6c Attributes: {class=META-INF/sca-policy-1.1-intents-definitions-cd03.xml} ### ClassLoader: sun.misc.launcher$appclassloa...@4c6c4c6c Attributes: {class=org/apache/tuscany/sca/binding/sca/definitions.xml} ### ClassLoader: sun.misc.launcher$appclassloa...@4c6c4c6c Attributes: {class=org/apache/tuscany/sca/implementation/java/definitions/definitions.xml} ### ClassLoader: sun.misc.launcher$appclassloa...@4c6c4c6c Attributes: {class=META-INF/sca-policy-1.1-intents-definitions-cd02.xml}

Everything works if I work around the duplicate definitions with this:
if (documents.contains(url))
  continue;

but that still doesn't explain why there's duplicates in the first place...
--
Jean-Sebastien

Reply via email to