Comments (12)
Wow, it's really kind of a broken framework design. If the org.apache.logging.log4j.util.Activator is started, it lock ProviderUtil.STARTUP_LOCK
and then later it unlocks it if and only if there is a provider.
Then, if a different thread comes to org.apache.logging.log4j.util.ProviderUtil.lazyInit() it will find that ProviderUtil.STARTUP_LOCK
is locked and will block indefinitely:
How broken is that?
I'm still concerned whether I'm seeing the same problem as @speckyspooky or a different problem.
The early activation appears to be a side-effect of the start levels of the product and although we might change those, if BIRT is installed in an Eclipse IDE, I would expect the same problem to arise.
from birt.
I can reproduce the problem in the IDE when the start levels of the debug launch are like those specified in the product:
The key to the problem is the early start thread holding the lock. I have no idea what's (if anything) has changed. But it's a fundamental problem in the logging framework and I really want a fix that will allow BIRT to run in any IDE.
In any case, it's easy to reproduce now and I have prototyped horrible, sickening hack in uk.co.spudsoft.birt.emitters.excel.framework.ExcelEmitterPlugin.start hat does actually fix the problem at least when debugging:
I will build the all-in-one product locally and verify that the launched unzipped product works before proceeding with a PR.
from birt.
Yes, with this approach the following information is logged on startup about all the services that are registered:
Aug. 17, 2024 4:58:07 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.slf4j.simple.SimpleServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle slf4j.simple
Aug. 17, 2024 4:58:08 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.apache.logging.log4j.util.EnvironmentPropertySource of service org.apache.logging.log4j.util.PropertySource in bundle org.apache.logging.log4j.api
Aug. 17, 2024 4:58:08 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.apache.logging.log4j.util.SystemPropertiesPropertySource of service org.apache.logging.log4j.util.PropertySource in bundle org.apache.logging.log4j.api
Aug. 17, 2024 4:58:08 PM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider org.apache.logging.slf4j.SLF4JProvider of service org.apache.logging.log4j.spi.Provider in bundle org.apache.logging.log4j.to.slf4j
And then we see POI doing actual logging, which might be useful in the future for tracking down problems:
!ENTRY uk.co.spudsoft.birt.emitters.excel 1 0 2024-08-17 16:59:33.259
!MESSAGE start:org.eclipse.birt.report.engine.content.impl.ReportContent@7d24dcb3
[qtp805898248-117] WARN org.apache.poi.POIDocument - DocumentSummaryInformation property set came back as null
[qtp805898248-117] WARN org.apache.poi.POIDocument - SummaryInformation property set came back as null
Because there is now Provider, the deadlock is avoided.
from birt.
@merks Merci beaucoup!
I have done the retest with the latest build version BIRT 4.17, N202408171542.
The retest is successfully and the excel output works now perfect. The excel documents (XLSX & XLS) are created normally.
from birt.
The other output formats like PDF, DOCX, PPTX, ODT, ODS and ODP can be created normally.
from birt.
Retest done with BIRT 4.17 N202408170550 with the same result:
-
all-in-one-designer
1.1 all-in-one-designer, create the excel directly: excel = error
1.2 all-in-one-designer, start preview and afterwards create the excel: preview = ok, excel = error -
OSGi runtime
- create the demo at viewer level and afterwards create the excel: preview = ok, excel = ok
- Local environment
- 2 test cases (see above): preview = ok, excel = ok
(I have tested with FireFox & Edge.)
from birt.
For me it just hangs. When I exit the application, which I started with -consoleLog, the log contains the following, which suggests that POI is waiting for a logging service
2024-08-17T06:53:11.114430900Z qtp1861377027-100 FATAL Interrupted before Log4j Providers could be loaded. java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1011)
at java.base/java.util.concurrent.locks.ReentrantLock$Sync.lockInterruptibly(ReentrantLock.java:161)
at java.base/java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:372)
at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:151)
at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:138)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:89)
at org.apache.poi.POIDocument.<clinit>(POIDocument.java:65)
at uk.co.spudsoft.birt.emitters.excel.XlsEmitter.createWorkbook(XlsEmitter.java:49)
at uk.co.spudsoft.birt.emitters.excel.ExcelEmitter.start(ExcelEmitter.java:343)
at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRangeRender.render(RenderTask.java:531)
at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:278)
at org.eclipse.birt.report.service.ReportEngineService.renderReport(ReportEngineService.java:1263)
at org.eclipse.birt.report.service.BirtViewerReportService.renderReport(BirtViewerReportService.java:303)
at org.eclipse.birt.report.service.actionhandler.BirtRenderReportActionHandler.__execute(BirtRenderReportActionHandler.java:63)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:88)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:190)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:80)
at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:167)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:233)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:523)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:332)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
When I try to move the initialized then it hangs there:
2024-08-17T09:25:30.232295400Z qtp466409782-84 FATAL Interrupted before Log4j Providers could be loaded. java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1011)
at java.base/java.util.concurrent.locks.ReentrantLock$Sync.lockInterruptibly(ReentrantLock.java:161)
at java.base/java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:372)
at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:151)
at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:138)
at uk.co.spudsoft.birt.emitters.excel.ExcelEmitter.start(ExcelEmitter.java:323)
I have developed a strong dislike for logging frameworks the past weeks So much complexity and then strange incompatibilities when different frameworks use different libraries/versions.
I think I would need to attach a remove debugger to see why there is apparently a deadlock and I have to hope this is the same problem as @speckyspooky is seeing.
from birt.
Even moving it to the bundle start then hangs there:
2024-08-17T10:40:29.124930200Z qtp324477266-116 FATAL Interrupted before Log4j Providers could be loaded. java.lang.InterruptedException
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1011)
at java.base/java.util.concurrent.locks.ReentrantLock$Sync.lockInterruptibly(ReentrantLock.java:161)
at java.base/java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:372)
at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:151)
at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:138)
at uk.co.spudsoft.birt.emitters.excel.framework.ExcelEmitterPlugin.start(ExcelEmitterPlugin.java:60)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
from birt.
The situation is strange and I don't know what is the reason of this changed behavior may be it is a side-effect with 2024-09
and only in combination with the IDE.
So I doubled checked my IDE-dev-console and see the following line which could be the confirmation of your finding:
But I don't know why it is working from eclipse-IDE. Could it be that the process handling is another one or there is later a logger given and will be used...
from birt.
I think I have a much better/nicer way, i.e., ensure there is a dependency on org.apache.logging.slf4j. Given that the product is using slf4j.simple, that should actually be better and allow POI to do actual logging. I will try that approach now. It works in debug mode, so it looks promising!
from birt.
It looks very nice. I will do me retest with the new version.
from birt.
Good news coming back from vacation. Thanks, guys.
from birt.
Related Issues (20)
- Excel-emitter (Spudsoft): Grids and tables with merged rows and image can cause NPE HOT 1
- ClassCastException: Report-processing with "HTML-table-structures" cause exception if the structure contains comments HOT 2
- PDF/A-3 support, validation fails HOT 11
- Invalid signature error in runtime tests HOT 7
- Creating/Editing datacubes leads to error HOT 11
- Support for DuckDB JDBC HOT 4
- Track down tests that fail to render their expected image content HOT 8
- Enhancement, JDBC driver manager - configuration of the property validation HOT 2
- Batik URL error when loading external image HOT 7
- PDF-emitter: UserProperties like standard configuration at designer level HOT 1
- Performance issue occurs when dataset has a parameter mapped to int8 type on PostgreSql HOT 11
- XML source not synchronized with outline view
- Test-element "TestingBall" is visible for "Insert Element", preview generation failed - (only for designer test reasons) HOT 1
- Excel & Indent (#1666): NPE can be produced in special cases of images without wrapped grid/table e.g. a single chart HOT 1
- BIRT, link styling "bookmarks" & "hyperlink": use configured styling and avoid standard hyperlink text decoration (#1025) HOT 4
- Reports exported in DOC format does not show report content properly HOT 4
- Excel, antidiagonal: the antidiagonal is set at background of merged cells - visible if rows will be added (#1866) HOT 1
- Excel, prototype emitter: avoid the diagonal print if the style is unset (= "none", discussion #1866) HOT 1
- Word, page size: output not limited to maximum possible width & height of word (#1869)
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 birt.