[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [virgo-dev] Cannot inject blueprint environment managers using gemini

Hi Anthony

This post should have been posted to gemini-dev, so I've cc'd them in.

It sounds like a bug, although a little obscure since no-one else has hit it before AFAIK, so perhaps you'd like to raise a bug, attach a small testcase based on the code below (and possibly consider submitting a patch :-) ).

Regards,
Glyn

On 8 Aug 2012, at 15:37, Anthony Bargnesi wrote:

folks,

I've posted to the forum without any response at http://www.eclipse.org/forums/index.php/t/369147/.

I've defined a blueprint xml with 'blueprintContainer' and 'blueprintBundleContext' environment managers:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <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>

I define the ReferenceManager class 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 deploy my bundle to the pickup directory of Virgo (tomcat server 3.5.0 / Gemini Blueprint 1.0.0.RELEASE) I have received the following errors:

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


I have confirmed these beans are added in the gemini code (here), but it doesn't seem to work for me.

Is this a bug or am I missing some blueprint configuration?

Thanks!
Anthony Bargnesi
_______________________________________________
virgo-dev mailing list
virgo-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/virgo-dev