Forum Home » Fuse Distributions » Fuse ESB

Thread: Exception when publishing an OSGi Service using Blueprint

 
This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 11, 2010 4:28 PM Last Post By: thygesen
thygesen

Posts: 31
Registered: 04/04/09
Exception when publishing an OSGi Service using Blueprint
Posted: Apr 11, 2010 3:23 PM
 
  Click to reply to this thread Reply
I have tried out the example described in chap. 8 Fuse ESB documentation http://fusesource.com/docs/esb/4.2/deploy_osgi/DeploySimple-Publish.html
It does not work! Can someone please tell me how to get the sample to work.

I get this exception:

20:19:51,129 | ERROR | pool-2-thread-2 | BlueprintContainerImpl | container.BlueprintContainerImpl 337 | Unable to start blueprint container for bundle null
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.apache.geronimo.blueprint.container.BlueprintContainerImpl.checkDirectives(BlueprintContainerImpl.java:180)
at org.apache.geronimo.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:232)
at org.apache.geronimo.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:211)
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:207)
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:619)

Please. I only want answer regarding this example or how to use blueprints. NOT any other solutions e.g. Bnd or iPojo, scr ect.

/Peter
thygesen

Posts: 31
Registered: 04/04/09
Re: Exception when publishing an OSGi Service using Blueprint
Posted: Apr 11, 2010 4:28 PM   in response to: thygesen in response to: thygesen
 
  Click to reply to this thread Reply
Attachment osgi-service.zip (14.3 KB)
Stupid me finally figured it out. However there is a minor error in the documentation.

Example 9.5. Blueprint File for Exporting a Service in "Deploying into the OSGi Container" Book chap. 8 http://fusesource.com/docs/esb/4.2/deploy_osgi/DeploySimple-Publish.html does not include an id attribute on the service element. Without this I get an exception as described above.

Example 9.5. should read:
<service id="helloservice" ref="hello" interface="org.fusesource.example.service.HelloWorldSvc"/>

BTW this article help me to locate the problem: http://www.ibm.com/developerworks/opensource/library/os-osgiblueprint/index.html