Question

I'm using Spring and Spring Integration in a service implementation packaged as an OSGi bundle. The service is published by Blueprint, or more specifically Gemini Blueprint [http://www.springframework.org/schema/osgi]

<bean id="myService" class="org.example.mti.MyServiceImplementation"/>
<osgi:service ref="myService" interface="org.example.mti.api.MyService"/>

The context files are in META-INF/spring/applicationContext*.xml

This works fine for some stub services, like memory backed DAOs, which don't rely on libraries for their implementation. The services are registered and can be exercised by another bundle.

For more complicated services, where I'm using Spring Integration, the service implementation clearly needs access to the Spring classes, which are exported by the normal Spring library bundles.

I'm using Bundlor to manage the MANIFEST.MF file. I've tried Spring Bundlor 1.0.0.RELEASE and Eclipse Virgo Bundlor 1.1.0.M3.

My understanding is that Bundlor is meant to be able to scan the Blueprint context files to determine the classes required, but I'm not seeing anything terribly useful added to the Import-Package manifest header.

Import-Package:
 org.example.dao,
 org.example.domain,
 org.example.mti.api,
 javax.inject,
 org.springframework.integration,
 org.springframework.integration.annotation,
 org.springframework.integration.support

When trying to run the bundle using Pax Exam, under Felix, I see ClassNotFoundException

java.lang.ClassNotFoundException:
    org.springframework.integration.gateway.GatewayProxyFactoryBean

I've tried setting both the Bundle-Blueprint and Spring-Context manifest headers in manifest.mf, and they're copied to MANIFEST.MF, but no new Import-Package values are added.

Is it expected that adding, for example, an <int:gateway .../> into the blueprint context will allow Bundlor to correctly determine the runtime dependencies, such as the GatewayProxyFactoryBean above?

If Bundlor cannot determine the correct Import-Package value then how do you manage these 'internal' package requirements? It's unreasonable, I think, to have to list every possible package within some third party library. Is there some equivalent of the Import-Library I vaguely recall from Spring DM?

References:

http://static.springsource.org/s2-bundlor/1.0.x/user-guide/htmlsingle/user-guide.html http://blog.springsource.org/2009/09/26/bundlor-adds-support-for-the-blueprint-service/

No correct solution

OTHER TIPS

Answering my own question with a potential solution.

DynamicImport-Package: org.springframework.*

While this is a bit of a hack, it does work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top