osgi

OSGi: Does Blueprint replace Declarative Services?

The new R4.2 spec for OSGi describes the Blueprint service, for dependency injection and service wiring. Does Blueprint replace Declarative Services (which is still part of the spec, as well), or are they intended to work together? Is Blueprint already available for the popular implementations (Felix and Equinox)? ...

How can I combine WAR packaging and OSGi bundle creation in Maven?

I want to deploy one of my OSGi bundles with a war package structure so it is recognized as a web application by Struts. I use Maven, so I get WAR packaging built-in and I have the Maven bundle-plugin to create the OSGi compatible manifest for me. The problem is, the two don't work together, so the bundle plugin is not aware that the cl...

How do I deploy a webapp into Apache Felix?

What bundles do I need to install? At least, this would have to be a servlet container / web server such as Jetty, but will the basic org.apache.felix.http.jetty bundle do, or is there anything else needed to discover the web.xml in other bundles? Do I put the webapp in a standard WAR, add OSGi headers and am done? Or are there any weba...

How do I avoid having to manually tweak Import-Package headers with Maven bundle-plugin?

I'm happily using the Maven bundle-plugin to create OSGi manifest headers for my modules. However, when there are configuration files that pull in classes which aren't referenced directly in the code, the plugin can't tell which packages it's going to need. One example is a bundle with domain models that constitute a Persistence Unit fo...

Achieving Eclipse-like OSGi launcher

Hello All, I am building an OSGi application and need to create an Eclipse-like OSGi application launcher. For those who do not know, when an OSGi application is run through Eclipse's OSGi framework, Equinox launches and automatically manages the order of bundles being started and stopped. From what I have experienced so far, it seems ...

OSGi: What are the differences between Apache Felix and Apache Karaf?

Apache Karaf is a sub project of Apache Felix. It is defined as "a lightweight OSGi container". I don't understand when should I use the heavyweight and when to use the lightweight. Their site doesn't explain this too much ...

Java plugin framework choice

We're trying to determine how to implement a simple plugin framework for a service we are implementing that allows different types of calculators to be "plugged-in". After reading a number of posts about Java plugin frameworks, it seems like the most common options are: OSGI "Rolling your own" plugin framework The Java Plugin Framewor...

Is there a Maven build for eclipselink that makes the OSGi bundles run in Felix and others?

The Eclipselink OSGi bundles seem have trouble working in some OSGi containers, notably Felix, because they fail to import packages (and that are exported by the system) that they actually require. One example is the missing import of javax.xml.namespace in the core bundle of the current 1.1.3 release. The eclipselink team has targeted ...

Using Guice with OSGi

I have a project that I am trying to convert to OSGi. However, this project has been built with Guice as its dependency injection manager. It's a large project with Guice interwoven all throughout. Guice has been giving me many fits with the conversion process. Specifically, it has been given me a NoClassDefFoundError for com.google.inje...

JPA Entity (in multiple persistence-unit) in OSGi (Spring DM) Environnement is confusing me.

Hi, I'm a bit confused about a strange behavior of my JPA's related objects. I have three bundle : The User bundle does contain some user-related objects, but mainly the User object. The Energy bundle does contain some energy-related objects, and particularly a ConsumptionTerminal which contains a List of User. The Index bundle doe...

New URLStreamHandlers in glassfish

I have a legacy application that I'm trying to port to Java EE. Presently this application calls URL.setURLStreamHandlerFactory() to register some custom URL protocol handlers. This call fails under Glassfish v 2.1 and 3 because glassfish has already registered a factory. I've tried using the java.protocol.handler.pkgs system property...

Can Eclipse 3.5 discover all bundles in the plugins dir?

Simple usecase: assemble an Eclipse product using simple scripts, just dumping bundles into the plugins dir. This used to work with 3.3 - with 3.5 it's broken: my application doesn't start as the app plugin is not found. Question: what's the easiest way to fix that? This seems to be the only pain in the whole upgrade process for me. ...

Java: Dynamically Load Multiple Versions of Same Class

I've looked all around and I haven't been able to figure out how to accomplish this. What I'd like to be able to do is to load set of classes, probably all in the same folder. All of which implement the same interface and are the same class, then in my code I'd like to be able to call functions on those classes. Any help you can give, ...

Federated Identity Management

I'm looking for a way to pull user (eg. inetOrgPerson) information in a federated way. For the most part, this information will come from LDAP but could come from secondary systems. I've looked at things like Jasig's Person Directory (married to Spring and we don't use it) and ArisID (no examples of use, yet). I'm working inside of OS...

osgi-like framework without the import/export restrictions?

I like OSGi, but the import/export restrictions and the lack of context class loader creates havoc when trying to use 3rd party libraries (e.g., some libraries try to find file.xml in META-INF, expecting for all such files in all jars to be returned, other libraries use ServiceLoader). I want OSGi's dynamic loading, ability for handling...

When to use ServiceTracker vs ServiceReference

I am just starting with OSGI programming and have come across two ways to listener for services being activated. The first way, from an EclipseRCP book, uses ServiceReference: String filter="(objectclass="+IModelCreator.class.getName()+")"; context.addServiceListener(this, filter); modelCreators = Collections.synchronizedMap( new H...

How to restrict program resources + rights in JVM/OSGi?

I want to create a website where people can solve programming tasks and eventually upload their solution (in any JVM-language) in order to verify it and share it with others. I figured OSGi (learning it right now) might be a good tool to handle this task (is it?). But obviously I'm a little anxious about letting other people executing t...

Is there a way to secure access to bundles in OSGi?

I have an application consisting of several OSGi bundles. I would like to enforce that some of them only provide other bundles access to their services if a valid token (e. g. a license key) has been presented. Here's why I would want to restrict access to those bundles: Security: They don't have their own access policies because thes...

What does Tool/Bundle-Name/Export-Package etc. mean in a jar manifest

I'm looking at the manifest.mf for some apache libraries. While I can guess what Export-Package means, I can't find any documentation for these attributes ? Could anyone point me in the right direction. Here.s an example: Manifest-Version: 1.0 Created-By: 1.6.0_07 (Sun Microsystems Inc.) Built-By: pemben Implementation-Title: Commons Be...

I want to load my OSGI jar files from a database or other source.

Do i need to supply a custom ClassLoader ? Thinking out loud this does not appear to be the right approach because inside the classloader one does not know the required version. ...