FELIX-6812 Follow-up: escape the pid in the service.pid filter (#563) * FELIX-6812 Follow-up: escape the pid in the service.pid filter FELIX-6812 replaced getConfiguration(pid, "?") with a listConfigurations call, and it builds the filter by concatenating the pid. A pid is not a filter-safe value, and the class already escapes one in findExistingConfiguration. A pid holding an asterisk builds a substring filter. listConfigurations then returns configurations the event was not about, and ConfigInstaller writes the first of them back to that other configuration's file. A pid holding a parenthesis throws InvalidSyntaxException instead, which the catch reports as a failure to save, so the configuration is never written back. escapeFilterValue left the backslash alone, although the OSGi filter grammar reserves it. A pid holding a backslash therefore stayed ambiguous after the escaping. The backslash is escaped first, or the escapes added after it would be escaped a second time. The method now matches literals rather than patterns. It compiled four patterns per call, and FELIX-6812 moved it from findExistingConfiguration, called once per file install, to doConfigurationEvent, called for every configuration event. Two tests raise CM_UPDATED for a pid holding an asterisk and for a pid holding a backslash, and each one fails when its escape is removed. * FELIX-6812 Follow-up: the two tests the change left green and empty FELIX-6812 moved the CM_UPDATED path from getConfiguration to listConfigurations, and two tests kept the expectations of the older call. Neither test calls EasyMock.verify, so an expectation nothing consumes fails nothing. testUseExistingConfigAndObserveCMDeleted expects listConfigurations for any argument and answers null. The handler then returns before it reads anything, so the test asserts nothing at all while it passes. It now expects the filter the handler builds and answers with a configuration. testUseExistingConfigWithFileinstallFilenameAndObserveCMDeleted still expects getConfiguration and update. The CM_UPDATED path writes the file and calls no method on the configuration, and getConfiguration is reachable from setConfig only, which this test never calls. Both tests verify their mocks now, which is what makes an expectation load-bearing. The dead expectations go, and the Capture that fed update goes with them. Adding the verify call before removing the expectations fails on Configuration.update, which is the measurement behind this commit.
The Apache Felix project is a collection of semi-related OSGi sub-projects that build and release individually.
Sub-projects build and release individually and each declares its own minimum Java version, so there is no single repository-wide baseline. The CI build (.github/workflows/maven-ci.yml) compiles and tests the covered sub-projects on Java 17, 21, 25 and 27.
The Apache Felix Framework no longer supports the OSGi security layer. Java SE 24 permanently disabled the Security Manager (JEP 486), so permission checks can no longer be enforced and System.setSecurityManager throws. Accordingly:
org.osgi.framework.security property now fails with a SecurityException rather than silently starting without the requested security.Bundle.hasPermission(...) returns true unless a SecurityProvider is installed.AdminPermission, ServicePermission, PackagePermission, and friends) is still exported, so bundles referring to those types keep compiling and resolving.org.apache.felix.framework.security sub-project has been removed.If you need the security layer, stay on a release that predates this change and run it on Java 21 or earlier.
The flagship project is the Apache Felix Framework which implements the OSGi Core R7 specification. The /framework directory contains the source and build tree for the OSGi-compliant framework implementation.
Directly related projects:
/main* - provides an executable jar that launches the Felix framework./log*/resolverSeveral sub-projects cover various OSGi Compendium specifications such as:
/configadmin/configurator/converter/coordinator/deploymentadmin/deviceaccess/scr*/eventadmin/http/http/io/metatype/prefs/upnp/useradmin/wireadminSeveral projects provide extra features to an OSGi runtime.
/bundlerepository - Bundle repository service./connect - A service registry that enables OSGi style service registry programs without using an OSGi framework./dependencymanager - A versatile java API, allowing to declaratively register, acquire, and manage dynamic OSGi services./fileinstall* - A utility to automatically install bundles from a directory./gogo - A command line shell, runtime and set of base commands for interacting with and introspecting an OSGi framework./healthcheck/* - An extensible framework to monitor the status of the OSGi container at runtime. (contains systemready)/inventory - Provides some mechanisms to get the current state of the system and therefore provides an inventory of the system./ipojo - A service component runtime aiming to simplify OSGi application development./jaas - Bundle to simplify JAAS usage within OSGi environment./logback - A simple integration of the OSGi R7 Log (1.4) service to Logback backend./metrics/osgi - Collecting and publishing metrics related to OSGi applications/rootcause - Finding the root cause of problems with OSGi declarative services components./utils - Utility classes for OSGi (intended for embedding within other bundles.)/webconsole* - Web Based Management Console for OSGi Frameworks.The /tools directory contains various build tools.
/tools/maven-bundle-plugin - A maven plugin for building OSGi bundles./tools/osgicheck-maven-plugin - Maven plugin for checking several OSGi aspects of your project.