Host bundle's Bundle-Blueprint manifest header should be able to reference a blueprint XML document from it’s fragment bundle
Issue
The OSGi Service Platform Enterprise Specification part 121.3.4 says:
A Bundle-Blueprint manifest header specified in a fragment is ignored by the Blueprint Container. However, XML documents referenced by a bundle’s Bundle-Blueprint manifest header, or its default, may be contained in attached fragments, as defined by the findEntries method.
So my understanding is that in host bundle, it’s Bundle-Blueprint manifest header can reference a blueprint XML document from it’s fragment bundle.
However, I tested it out but it does not seem that Aries is specification compliant on this.
Say, I have a fragment bundle and I have a blueprint xml file called "custom.xml" under it’s "src/main/resources/OSGI-INF/blueprint” folder. And then in a host bundle, I tried to reference this blueprint XML from it’s Bundle-Blueprint manifest header:
Bundle-Blueprint: OSGI-INF/blueprint/custom.xml
But wen I tried to deploy them, Aries Blueprint just threw the following exception back to me:
19:09:58,740 | ERROR | rint Extender: 2 | BlueprintContainerImpl | 21 - org.apache.aries.blueprint.core - 1.4.2 | Unable to start blueprint container for bundle jda.fuse.examples.blueprint-fragment-master
java.io.FileNotFoundException: Unable to find configuration file for OSGI-INF/blueprint/custom.xml
at org.apache.aries.blueprint.container.BlueprintContainerImpl.getResources(BlueprintContainerImpl.java:420)[21:org.apache.aries.blueprint.core:1.4.2]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:298)[21:org.apache.aries.blueprint.core:1.4.2]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[21:org.apache.aries.blueprint.core:1.4.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_67]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_67]
at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)[21:org.apache.aries.blueprint.core:1.4.2]
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[21:org.apache.aries.blueprint.core:1.4.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_67]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_67]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_67]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_67]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_67]
Environment
- JBoss Fuse
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
