osgi

Adding a ServiceListener with Spring DM

I am wondering if it possible to do the equivalent of public void start(BundleContext context) { String filter = "filter for my specific service"; context.addServiceListener(new MyServiceListener(), filter); } with Spring DM. I have found reference material for adding listeners for lifecycle management. But this relates t...

eclipse plugin not loading dll due to long path

I am building an eclipse plugin (a notes plugin, but its a eclipse plugin in the end). One of the plugins my plugin depends on needs to load a native dll. The problem is, that fails depending on where in the disk such dll is. If it is longer than a certain threshold I get the error below java.lang.UnsatisfiedLinkError: nlsxbe (The file...

How do I configure an OSGi environment so that it is possible to use it from the EclipseStarter class?

Hi there! Currently I'm trying to execute some bundles using the capabilities of the EclipseStarter class. If I run my program directly from Eclipse the OSGi service bundle is loaded and I'm able to install and start other bundles. But if I export my java program to a executable jar-file and run it from the command line the environment...

Which SOA architecture is most appropriate for a Java application?

I am currently working on a pretty large Java 6 application where we are looking to split some of our functionality out into a service oriented architecture. It seems that the primary SOA framework for the application space is OSGi and I have been looking into Felix and Knopplerfish but I wanted to make sure that this isn't my only opti...

How to obtain OSGi service references from a Servlet that is registered in OSGi HttpService?

It seems natural that a HttpServlet running in OSGi environment (i.e. registered in OSGi HttpService) would want to call some OSGi services to accomplish it's tasks. The question is how to obtain references to these OSGi service inside the servlet. One way would be to inject dependencies into the HttpServlet instance that is being regis...

OSGi felix: Sharing a class between the host application and a bundle possible?

Hi there! Inside my host application I tried implement a simple pushService, which shall be used to transfer an instance of a class named Vehicle to the OSGi world, by providing a set and get method. To be able to use the service I exported both the service interface and the Vehicle class to a jar file and imported that file within the ...

Why can't JAXB find my jaxb.index when running inside Apache Felix?

It's right there, in the package that it should be indexing. Still, when I call JAXBContext jc = JAXBContext.newInstance("my.package.name"); I get a JAXBException saying that "my.package.name" doesnt contain ObjectFactory.class or jaxb.index although it does contain both. What does work, but isn't quite what I want, is JAXBCo...

OSGi and legacy libraries

I've been looking into OSGi for a while and I'm wondering about the best way to deal with "legacy" libraries (that are released as plain JARs, not as OSGi bundles). What do you think is the best way to handle these? Modifying their manifest file and adding the minimal bundle-specific information, then repackaging them is what I do at th...

executing eclipse.buildscript task on a feature misses the fragment

I have a feature called foo, plugin called foo, and a single fragment foo.win32.x86. I should be able to execute a call to eclipse.buildscript within an ant file on a feature and have it create a build.xml for the feature, plugin, and fragment; however, all I get is the build.xml for the feature and plugin. The foo feature.xml: <?xml ...

Persistence.xml and OSGi (Equinox)

I am currently testing out using OSGi. I am running this through Eclipse. I want to have my DAO layer as part of an OSGi solution, but my first stumbling block is this error: Jun 29, 2009 6:12:37 PM org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.0.GA Jun 29, 2009 6:12:37 PM org.hibernate.ejb.Version <cl...

How to make eclipse aware of OSGI bundles within a maven repository (local &| remote)

I have a project which is build through maven. Each module is built as an osgi bundle. Within Eclipse the modules have also the plugin nature. Some modules require external dependencies (log4j, apache commons, ...), which are also available as plugins from a maven repository (for instance the spring enterprise repository, which is also...

osgi: fragment is not working outside eclipse pde (and no error appeared)

Context of this problem: OSGi and Eclipse Platform. I've got bundle (plugin) which is host for some fragment. Fragment is running only when I start it through Eclipse "run configuration" (I add it in plugin dependencies in run configuration of plugin), but when I am trying to export it either through eclipse or through maven tycho proje...

How to configure Felix OBR repositories list?

Is there any way to specify a number of OBR repositories in Felix's config.properties file? I do can add a repository at runtime, but I have to do it after restart. "Prefrences Service" does not help, it seems "Bundle Repository" does not use it. ...

Assimilate existing apps?

Hey Folks, I read all lot about rich client platforms and the OSGi framework, but stuck with this question: Is it possible to assimilate existing applications (either java-based or win32-based) in one application window? I aim at connecting different kinds of (existing) application in one application (with Eclipse RCP) to offer the gen...

A cycle was detected in the build path of project xxx - Build Path Problem

I'm in the process of converting my projects to OSGI bundles using maven and eclipse. Maven builds the stuff just fine, only I get the above error now within Eclipse. How can I find out which project causes this? Is there a special view or something? How can this happen, I would expect that maven can detect cyclic dependencies as well? ...

Remoting and OSGi

Is there an elegant way to use Services across or between OSGi containers? Is it even possible? For instance, lets say I have a service interface on my local machine. What methodologies/technologies can I use to get that service interface accessible through a remote OSGi container's BundleContext? ...

OSGI Declarative Services (DS): What is a good way of using service component instances

I am just getting started with OSGI and Declarative Services (DS) using Equinox and Eclipse PDE. I have 2 Bundles, A and B. Bundle A exposes a component which is consumed by Bundle B. Both bundles also expose this service to the OSGI Service registry again. Everything works fine so far and Equinox is wireing the components together, ...

getting started with osgi + felix

Which packages of Felix do I need to get started? There are a zillion of them on the downloads page. (p.s. is the name a reference to the Odd Couple + in contrast to OSGI's "Oscar" reference framework? this occurred to me after reading one of the tutorial pages & I got a chuckle out of it.) ...

Using XML parser implementation as OSGi service

Hello, I am developing an application using OSGi (Equinox platform), and one of the bundles needs to parse XML files. So far I implemented this with SAX (javax.xml.parsers.SAXParserFactory) and I would like to retrieve the SAXParserFactory from the platform. I saw the OSGi standard provides for a XMLParserActivator to allow JAXP implem...

pax-run using Maven Plugin in pom.xml

How can I execute Pax-Runner tasks using a Maven Plugin, which I can specify in the pom.xml file? i.e. I can do the following in command line using Pax-Runner (to convert a war file into an OSGi bundle) pax-run war:file:C:/somefile.war warref:C:/somefile.properties What should I do to make it happen in a pom.xml file? Thanks in adva...