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