Listing loaded OSGI Bundles in Lucee
Updated on September 15, 2021
By Pete Freitag
By Pete Freitag
Here's a quick code snippet that will output a list of OSGI java bundles and bundle versions that are loaded / installed on Lucee:
//CFMLEngine engine = getPageContext().getCFMLFactory().getEngine(); //org.osgi.framework.BundleContext bundleContext = engine.getBundleContext(); //array of org.osgi.framework.Bundle objects bundles = bundleContext.getBundles(); for (b in bundles) { writeOutput(b.getSymbolicName() & ":" & b.getVersion() & "<br>"); }
Here's a link to run the code on trycf. It was inspired by the "getBundles" action of the cfadmin tag (source).
You might be wondering why not just use the cfadmin
tag, well it requires a password for all operations, which makes sense for many of the operations, but I don't think it should be necessary to list the bundles.
Listing loaded OSGI Bundles in Lucee was first published on September 15, 2021.
If you like reading about lucee, osgi, or java then you might also like:
- Spring4Shell and ColdFusion
- Log4j CVE-2021-44228 Log4Shell Vulnerability on ColdFusion / Lucee
- Updating Java on ColdFusion or Lucee
- Tomcat Java 10 on Windows CreateJavaVM Failed
The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.