Comments (4)
Ii would be interesting to know how the bundle context became invalid in the first place... However, the consistency checker must be hardened regardless.
from neba.
I've taken a look at the felix bundle context implementation to better understand how this happens. First of, this only happens on very old version of Felix (e.g. those shipped with CQ 5.3). It seems to me that this is a felix-internal issue, perhaps because the NEBA bundle is a fragment. Here is the code excerpt from [1]:
353 private void More ...checkValidity()
354 {
355 if (m_valid)
356 {
357 switch (m_bundle.getState())
358 {
359 case Bundle.ACTIVE:
360 case Bundle.STARTING:
361 case Bundle.STOPPING:
362 return;
363 }
364 }
365
366 throw new IllegalStateException("Invalid BundleContext.");
367 }
Unfortunately, the exception does not tell what the unexpected state is.
from neba.
After some analysis, I have come to the conclusion that the reference checker itself may be discarded due to an earlier architecture change.
When a bundle is stopped or fails, the ContextShutdownHandler removes all data related to the bundle from all registries. Consequently, it is safe to store a reference to the source bundle in the OsgiBeanSource. This makes it possible to simply check the validity there - which is also much better from an OO point of view:
Before:
consistencyChecker.isValid(source)
After:
source.isValid();
I'll put this on a feature branch.
from neba.
Done - merged pull request.
from neba.
Related Issues (20)
- Update to Spring 5.3.1_1 HOT 1
- Update to Spring 5.3.2_1 HOT 2
- Update to Spring 5.3.3_1 HOT 1
- Update to Spring 5.3.7_1
- Update to Spring 5.3.8_1
- Upgrade to travis-ci.com HOT 1
- Update to Spring 5.3.13_1 HOT 1
- Introduce a github action CI/CD workflow as a replacement for the decomissioned travis-ci workflow HOT 1
- Update to Spring 5.3.15_1 HOT 1
- Automate release process using Github actions
- Update Spring version to mitigate CVE-2022-22950 / cve-2022-22965: DoS and RCE HOT 1
- Release an update for Spring CVE-2022-22968
- Log viewer: superfluous use of "/g" regex causes backtracking, potential recusion errors HOT 1
- Update to Spring 5.3.21_1 HOT 1
- Support Jackson-databind 2.13.4 HOT 1
- AEM SP 6.5.18+ breaks MVC integration
- Update to Spring 5.3.31
- Update to Spring 5.3.34_1 HOT 1
- Support mixing neba core and spring -based models in the same package HOT 1
- Support @ResourceModel as meta-annotation for neba core models HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neba.