jbonofre opened a new pull request, #3060: URL: https://github.com/apache/karaf/pull/3060
Backport of #3058 to karaf-4.4.x. ## Problem `JmsServiceImpl.delete()` and `JmsServiceImpl.lookupConnectionFactory()` put the connection factory name into OSGi filters without escaping. So `jms:delete "*"` deletes every `org.ops4j.connectionfactory` configuration, the other `jms:*` commands (and `JmsMBean` operations) resolve `*` to the highest ranked connection factory, and a name containing `(`, `)` or `\` can't be found or deleted at all. ## Fix Escape the name with the OSGi filter syntax (`\`, `*`, `(` and `)` preceded by a backslash) in both filters, as in #3058. ## Differences from #3058 The cherry-pick didn't apply cleanly, because `JmsServiceImpl` on 4.4.x is the pax-jms based one: - `delete()` filters on the `org.ops4j.connectionfactory` factory PID, so the escaping is applied to that filter. - `delete()` now ignores a `null` result from `listConfigurations()`, as on main. Without this, deleting a name that matches nothing (including `*` once it is escaped) throws a `NullPointerException`. - `JmsServiceImplTest` uses `javax.jms` instead of `jakarta.jms`, and the `org.ops4j.connectionfactory` factory PID. - No `jms/pom.xml` change: junit is already inherited from the root pom on 4.4.x. ## Testing `mvn -pl jms verify` passes on this branch. The 6 tests in `JmsServiceImplTest` pass, and 4 of them fail without the fix, as on main. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
