Spring Dynamic Modules for OSGi™ Service Platforms

Known Issues

Authors

Costin Leau (SpringSource)

1.0.3

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


Preface
1. Known Issues
1.1. CGLIB proxying fails with NPE from time to time
1.2. Using classpath prefix on the root classpath (/) fails
1.3. Publishing prototypes as OSGi services
1.4. Service proxy/object equality

Preface

This document describes known issues (and possible work-arounds). Each issue mentions the section of the reference documentation that explain the behaviour along with the associated JIRA entry which provides an estimate on when it will be solved. As a rule, the next release Spring Dynamic Modules aims to solve most, if not all of them.

Chapter 1. Known Issues

As a side note, it worth pointing out that the issues below are not really bugs but rather improvements.

1.1. CGLIB proxying fails with NPE from time to time

During our tests, we have encountered a strange cglib behaviour; when trying to proxy java.* classes the process fails with a NullPointerException. Further more, the bug cannot be reproduce constantly, depending a lot on the number of runs and JVM platform used. We believe the cause is a Weak reference - see this discussion.

See OSGI-110

1.2. Using classpath prefix on the root classpath (/) fails

Calling getResource()/getResources() from a Bundle, on the root folder (/) fails. Currently, only Equinox and Knopflerfish (2.0.3+) support this behaviour. At the moment of writing this document, Felix provides support for this in the upcoming 1.1.0.

See OSGI-210

1.3. Publishing prototypes as OSGi services

Due to the way OSGi platform deals with OSGi services (it caches the instance and returns it every time), prototypes are not fully supported. Spring-DM publishes a proxy that on each call, delegates back to the target application context for retrieving the instance. While with other beans this works, in case of prototypes, this results in one-instance-per-invocation which is incorrect. Additional functionality needs to be added to fully support prototypes even though, as pointed out, this involves a knowledge between Client/Server regarding the publication contract.

See OSGI-237

1.4. Service proxy/object equality

Since Spring-DM uses run-time proxies, equality between objects that rely on private field comparison tends to fail. The problem becomes more apparent when dealing with sets that use service rather then service reference equality. Since the proxy does only method interception it does not seem to exist any practical solution at the moment. As a workaround, consider modifying your equality method or relying on the reference equality.

See OSGI-245