I have a class

  @Bean(id = "WorkflowCommandProvider")
  @Service(autoExport = "all-classes")
  public class WorkflowCommandProvider implements CommandProvider
  { ....

inside a fragment. The host has the

  Bundle-Blueprint-Annotation: true

Bundle-Header set. But now the WorkflowCommandProvider appears two times
inside the generated

  annotation-generated-blueprint.xml:
....
    <reference interface="org.osgi.service.prefs.PreferencesService"
id="PreferencesServiceWorkflowCommandProvider"/>
    <service auto-export="all-classes" ref="WorkflowCommandProvider"/>
    <bean
class="de.clustest.workflow.commandprovider.internal.WorkflowCommandProvider"
id="WorkflowCommandProvider">
        <property ref="PreferencesServiceWorkflowCommandProvider"
name="preferencesService"/>
    </bean>
    <reference interface="org.osgi.service.prefs.PreferencesService"
id="PreferencesServiceWorkflowCommandProvider"/>
    <service auto-export="all-classes" ref="WorkflowCommandProvider"/>
    <bean
class="de.clustest.workflow.commandprovider.internal.WorkflowCommandProvider"
id="WorkflowCommandProvider">
        <property ref="PreferencesServiceWorkflowCommandProvider"
name="preferencesService"/>
    </bean>
</blueprint>

and an error is logged:
org.osgi.service.blueprint.container.ComponentDefinitionException:
Unable to validate xml
        at org.apache.aries.blueprint.container.Parser.validate(Parser.java:288)
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:276)
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:228)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.xml.sax.SAXParseException: cvc-id.2: There are multiple
occurrences of ID value 'PreferencesServiceWorkflowCommandProvider'.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
        at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3182)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2777)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2714)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2066)
        at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
        at
com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:273)
        at
com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:240)
        at
com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:186)
        at
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:104)
        at javax.xml.validation.Validator.validate(Validator.java:127)
        at org.apache.aries.blueprint.container.Parser.validate(Parser.java:285)
        ... 10 more

It seems the annotations are parsed with the host and a second time with
the fragment.

Can you please help me to solve this?
thx
Sandro

Reply via email to