Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Exceptions injecting reserved beans in Blueprint
icon4.gif  Exceptions injecting reserved beans in Blueprint [message #900612] Tue, 07 August 2012 14:58 Go to next message
Anthony Bargnesi is currently offline Anthony Bargnesi
Messages: 5
Registered: August 2012
Junior Member
Hello,

I am having issues with 1.0.0.RELEASE of Gemini Blueprint in Virgo 3.5.0.

The blueprint specification states that blueprintContainer and blueprintBundleContext are reserved component ids in Blueprint. It mentions you can inject them into a managed bean using a 'ref'.

I've tried this and failed with:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'blueprintBundleContext' is defined

My blueprint is defined as:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="...1.0.0 namespace omitted to avoid spam message..."
  xmlns:xsi="...1.0.0 namespace omitted to avoid spam message..."
  xsi:schemaLocation="...1.0.0 namespace omitted to avoid spam message...
  ...1.0.0 namespace omitted to avoid spam message...">

    <bean id="referenceManager" class="com.acme.ReferenceManager">
        <property name="context" ref="blueprintBundleContext" />
        <property name="container" ref="blueprintContainer" />
    </bean>

    <reference id="acmeService" interface="com.acme.AcmeService" timeout="10000">
        <reference-listener ref="referenceManager" bind-method="bind" unbind-method="unbind" />
    </reference>
</blueprint>


The reference-listener ('referenceManager') is defined as:
public class ReferenceManager {

    private BundleContext ctx;
    private BlueprintContainer bc;

    public void setContext(BundleContext ctx) {
        this.ctx = ctx;
    }

    public void setContainer(BlueprintContainer bc) {
        this.bc = bc;
    }

    public void bind(ServiceReference ref) {
        System.out.println("<<< Binding service reference: " + ref + " >>>");
    }

    public void unbind(ServiceReference ref) {
        System.out.println("<<< Unbinding service reference: " + ref + " >>>");
    }
}


When I do not inject the two blueprint beans the reference listener binds/unbinds as expected.

Do I need to define additional beans to use blueprintContainer or blueprintBundleContext?

Thanks!
Anthony Bargnesi
Re: Exceptions injecting reserved beans in Blueprint [message #900855 is a reply to message #900612] Wed, 08 August 2012 13:52 Go to previous message
Anthony Bargnesi is currently offline Anthony Bargnesi
Messages: 5
Registered: August 2012
Junior Member
I see now that I should post this to the Gemini forum. Relocated to: http://www.eclipse.org/forums/index.php/t/369201/
Previous Topic:Hibernate Session Factory
Next Topic:Launching Virgo programmatically (say via Tanuki / java program)
Goto Forum:
  


Current Time: Mon Jul 28 18:40:42 EDT 2014

Powered by FUDForum. Page generated in 0.01639 seconds