eclipse-birt / birt

Eclipse BIRT™ The open source reporting and data visualization project.
http://www.eclipse.org/birt
Eclipse Public License 2.0
445 stars 388 forks source link

IPlatform:org.eclipse.birt.core.framework.Platform.platform is not initializing after OSGi PlatformLauncher successful startup #1281

Closed 94satya closed 11 months ago

94satya commented 1 year ago

For environment information please check the below details: Java- Java11 Birt: 4.9.0 BIRT_HOME: ReportEngine\platform OSGi: org.eclipse.osgi_3.17.200.v20220215-2237.jar Compatibilty state: org.eclipse.osgi.compatibility.state-1.2.600.jar

Link to get the Birt OSGi runtime: https://archive.eclipse.org/birt/downloads/drops/R-R1-4.9.0-202203161719/

Any runtime configurations/ any dependency is missing related to OSGi?

speckyspooky commented 1 year ago

Have you tried it with the latest version 4.13? The 4.9.0 an older version and currently we work only with the latest versions of BIRT.

94satya commented 1 year ago

As per suggestion, Tried with 4.13. Now platform is initializing but facing EmitterExtension loading issue for below 1- org.eclipse.birt.report.engine.emitter.config.postscript 2- org.eclipse.birt.report.engine.emitter.config.pptx 3- org.eclipse.birt.report.engine.emitter.docx 4- org.eclipse.birt.report.engine.emitter.pdf and few more emitters.

Part of stacktrace (getting inside configuration directory of the OSGi report engine)

!ENTRY org.eclipse.birt.report.engine.emitter.pdf 4 0 2023-05-16 23:14:32.225 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.birt.report.engine.emitter.pdf [94] Bundle was not resolved because of a uses constraint violation. org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.eclipse.birt.report.engine.emitter.pdf [osgi.identity; osgi.identity="org.eclipse.birt.report.engine.emitter.pdf"; type="osgi.bundle"; version:Version="4.13.0.v202303021806"; singleton:="true"] because it is exposed to package 'javax.annotation' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.18.100.v20220817-1601"; singleton:="true"] and javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.3.2"] via two dependency chains.

Chain 1: org.eclipse.birt.report.engine.emitter.pdf [osgi.identity; osgi.identity="org.eclipse.birt.report.engine.emitter.pdf"; type="osgi.bundle"; version:Version="4.13.0.v202303021806"; singleton:="true"] require: (&(osgi.wiring.bundle=org.eclipse.birt.core)(&(bundle-version>=2.1.0)(!(bundle-version>=5.0.0)))) | provide: osgi.wiring.bundle: org.eclipse.birt.core org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.18.100.v20220817-1601"; singleton:="true"]

Chain 2: org.eclipse.birt.report.engine.emitter.pdf [osgi.identity; osgi.identity="org.eclipse.birt.report.engine.emitter.pdf"; type="osgi.bundle"; version:Version="4.13.0.v202303021806"; singleton:="true"] require: (&(osgi.wiring.bundle=com.github.librepdf.openpdf)(&(bundle-version>=1.3.0)(!(bundle-version>=3.0.0)))) provide: osgi.wiring.bundle; bundle-version:Version="1.3.26"; osgi.wiring.bundle="com.github.librepdf.openpdf" com.github.librepdf.openpdf [osgi.identity; osgi.identity="com.github.librepdf.openpdf"; type="osgi.bundle"; version:Version="1.3.26"] import: (&(osgi.wiring.package=javax.annotation)(&(version>=1.0.0)(!(version>=4.0.0))))
export: osgi.wiring.package: javax.annotation

javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.3.2"] at org.eclipse.osgi.container.Module.start(Module.java:463) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1694) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

Due to this error emitters not loaded hence unable to generate the PDF and other formats.

wimjongman commented 1 year ago

What exactly are you trying to do?

94satya commented 1 year ago

Trying to setup BIRT runtime OSGi 4.13 for report generation with Java11. At the time of Platform.start() we could see the given statcktrace. !ENTRY org.eclipse.birt.report.engine.emitter.pdf 4 0 2023-05-16 23:14:32.225 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.birt.report.engine.emitter.pdf [94] Bundle was not resolved because of a uses constraint violation. org.apache.felix.resolver.reason.ReasonException: Uses constraint violation. Unable to resolve resource org.eclipse.birt.report.engine.emitter.pdf [osgi.identity; osgi.identity="org.eclipse.birt.report.engine.emitter.pdf"; type="osgi.bundle"; version:Version="4.13.0.v202303021806"; singleton:="true"] because it is exposed to package 'javax.annotation' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.18.100.v20220817-1601"; singleton:="true"] and javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.3.2"] via two dependency chains.

Hence 'EmitterExtension' unable to load the emitters like pdf, word etc. Only HTML and XLS emitter loaded(could see in the report log).

wimjongman commented 1 year ago

Yes, I can duplicate this. Can you use the other runtime? That one works.

94satya commented 1 year ago

Thanks for quick response. We tried below runtimes. 1- OSGi runtime 4.8 --> Issue: 'EmitterExtension' unable to load XLS emitter. Due to this we are unable to generate XLS reports. We can see the excel config and prototype excel emitter is there in the plugins but still not loading. 2- OSGi runtime 4.9/4.10/4.11/4.13 --> Issue: 'EmitterExtension' unable to load the emitters like pdf, word etc. Only HTML and XLS emitter loaded(could see in the report log).

wimjongman commented 1 year ago

try the non-osgi runtime from https://download.eclipse.org/birt/downloads/drops/latest/

e.g. birt-runtime-4.13.0-20230302.zip

94satya commented 1 year ago

@wimjongman For OSGi runtimes 4.10/11/13: We analyzed the issue and we could see that issue is due to com.github.librepdf.openpdf_1.3.26 jar(present in platform/plugins). Inside this jar MANIFEST.MF has Export-Package and Import-Package which uses javax.annotation. When we remove this javax.annotation from MANIFEST.MF for both Export and Import package. We could see emitters loaded properly e.g PDF, Word etc. and there were no error inside configuration folder as well.

Please let us know, if this can be a patch fix for 4.13 release and can be permanently fixed in upcoming release.

PFA updated MANIFEST.MF file (com.github.librepdf.openpdf_1.3.26 jar) for your reference. MANIFEST.txt

wimjongman commented 1 year ago

Thanks! Yes, please provide a PR.

94satya commented 1 year ago

@wimjongman We tried directly in the downloaded OSGi birt runtime 4.13 com.github.librepdf.openpdf_1.3.26 jar (platform/plugins) and updated the MANIFEST.MF file directly in local.

So not made any changes in the actual BIRT project. Trying to share information so that we can get your help fix this.

94satya commented 1 year ago

Thanks! @wimjongman. It will be very helpful if we can get patch fix for this in OSGi 4.13. This will really help us.

wimjongman commented 1 year ago

We don't do patches, unfortunately. This will hopefully be included in 4.14.

94satya commented 1 year ago

Thanks for response @wimjongman . We will upgrade to Birt OSGi 4.14 after the release. For now we are moving to production in couple of weeks with Osgi 4.13, But we can see FONT issue in PDF reports(basically fonts are not similar to BIRT OSGi runtime 2.5.2). Due to limited time we are looking for your help to move forward quickly and take it to the production. Kindly let me know if any other information required.

wimjongman commented 1 year ago

Due to limited time we are looking for your help to move forward quickly and take it to the production.

Are you asking for paid support?

94satya commented 1 year ago

I'm not sure on paid support. I need to check for that. Our focus was to understand what got changed related to FONT from 2.5.2 to 4.13 which is causing the issue. Any other additional dependency/ code changes expected in 4.13 OSGi runtime for Fonts.

Just for trial, We tried to replace the all fontsConfig.xml, fontsConfig_pdf.xml, fontsConfig_linux.xml and fontsConfig_win32.xml of OSGi runtime 4.13 with runtime 2.5.2. Still getting the same issue in the PDF.

merks commented 1 year ago

FYI, almost all the tests are currently working during the builds, so I suggest trying again with the latest builds. Also, I can generate a PDF report from the all-in-one product, so I believe it should all work now.

94satya commented 1 year ago

@wimjongman Hope reported issue will be addressed in 4.14 release. We are waiting for 4.14 OSGi runtime with fix. Thank you!

wimjongman commented 1 year ago

@wimjongman Hope reported issue will be addressed in 4.14 release. We are waiting for 4.14 OSGi runtime with fix. Thank you!

Since you figured out the solution, creating a pull request is the quickest route to success. Have you been able to check with the latest 4.14 nightly build?

94satya commented 1 year ago

@wimjongman Hope reported issue will be addressed in 4.14 release. We are waiting for 4.14 OSGi runtime with fix. Thank you!

Since you figured out the solution, creating a pull request is the quickest route to success. Have you been able to check with the latest 4.14 nightly build?

We would be more than happy to raise the PR, But before raising the PR can we discuss the change if you ok with quick call for 10-15mins? If yes, please share the details to have a call. Thank you.

wimjongman commented 1 year ago

Thanks @94satya. Please post any questions that you have here. Open source collaboration is through these discussions. Face to face we reserve for enjoying frosty beverages.

94satya commented 1 year ago

@wimjongman Thanks for quick response. Please help with the below points.

1- In order to solve the issue, com.github.librepdf.openpdf_1.3.26 jar (present in platform/plugins) needs to be upgraded by com.github.librepdf.openpdf_1.3.27 jar as javax.annotation is removed from Import/Export package.

There are few places that we identified as a place to change to update the com.github.librepdf.openpdf dependency version- 1- /org.eclipse.birt.report.engine.emitter.odp/META-INF/MANIFEST.MF 2- /org.eclipse.birt.report.engine.emitter.ppt/META-INF/MANIFEST.MF 3- /org.eclipse.birt.report.engine.emitter.pptx/META-INF/MANIFEST.MF 4- /org.eclipse.birt.report.engine.tests/META-INF/MANIFEST.MF

If above four places are correct then let us know else let us know from where we can update this dependency version in BIRT project to get the upgraded one(openpdf 1.3.27) in platform/plugins

speckyspooky commented 1 year ago

Short side information. If you check the latest built under path birt/plugins you will see that the library "com.github.librepdf.openpdf_1.3.30.jar" is there added. So it would be make sense to use 1.3.30 instead of 1.3.27.

And yes, I can confirm your results. The 4 mentioned locations used a fixed version number instead of the version range - see below. I the dependencies of openpdf would be changed to version "[1.3.0,3.0.0)" then the new version should be used.

openpdf

94satya commented 1 year ago

Short side information. If you check the latest built under path birt/plugins you will see that the library "com.github.librepdf.openpdf_1.3.30.jar" is there added. So it would be make sense to use 1.3.30 instead of 1.3.27.

And yes, I can confirm your results. The 4 mentioned locations used a fixed version number instead of the version range - see below. I the dependencies of openpdf would be changed to version "[1.3.0,3.0.0)" then the new version should be used.

openpdf

Thanks @speckyspooky Since Openpdf lib is already upgraded from 1.3.26 to 1.3.30 in ReportEngine\platform\plugins. Now only below files I will update with the range instead of fixed version. e.g. com.github.librepdf.openpdf;bundle-version="[1.3.0,3.0.0)".

1- /org.eclipse.birt.report.engine.emitter.odp/META-INF/MANIFEST.MF 2- /org.eclipse.birt.report.engine.emitter.ppt/META-INF/MANIFEST.MF 3- /org.eclipse.birt.report.engine.emitter.pptx/META-INF/MANIFEST.MF 4- /org.eclipse.birt.report.engine.tests/META-INF/MANIFEST.MF

@speckyspooky @wimjongman I'll raise the PR ASAP. Will update once completed. Thanks

94satya commented 1 year ago

@wimjongman @speckyspooky I have raised the PR. Kindly help review the same. Currently it shows that it is pending for agreement validation. PR: https://github.com/eclipse-birt/birt/pull/1423

Kindly let me know if anything need to do from my side. Thanks

94satya commented 12 months ago

Due to ECA validation failure closed existing PR: https://github.com/eclipse-birt/birt/pull/1423

Please refer the new PR: https://github.com/eclipse-birt/birt/pull/1429

94satya commented 11 months ago

@wimjongman @speckyspooky @merks I tried to integrate BIRT-runtime OSGi 4.14 nightly build, and using Java-11 and tomcat-8.5. At the time of Platform.start() we could see the below exception stack trace(generated inside ReportEngine\platform\configuration). Exception:- eclipse.buildId=unknown java.version=11.0.16 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

!ENTRY org.eclipse.equinox.simpleconfigurator 4 0 2023-09-27 16:15:10.203 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.simpleconfigurator [2] Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

at org.eclipse.osgi.container.Module.start(Module.java:463)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1852)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1845)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1788)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1750)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1672)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

!ENTRY org.eclipse.birt.core 4 0 2023-09-27 16:15:10.206 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.birt.core [3] Unresolved requirement: Import-Package: javax.servlet

at org.eclipse.osgi.container.Module.start(Module.java:463)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1852)

Please help verify the same if this exists at your side as well. It seems like used org.eclipse.equinox.simpleconfigurator_1.5.0.v20230919-1457.jar (present in ReportEngine\platform\plugins) is using Bundle-RequiredExecutionEnvironment: JavaSE-17 and unable to load on start with Java-11.

image

hvbtup commented 11 months ago

BIRT 4.14 requires Java 17.

94satya commented 11 months ago

Thank you @wimjongman @speckyspooky @merks @hvbtup for great support and help. If all ok please help close this issue. Thanks.

speckyspooky commented 11 months ago

You are welcome and very nice to hear that you have successful with your integration.

davidwwd2011 commented 9 months ago

@94satya Could you kindly post your final solutions? And how did you resolve the issue of missing latest Eclipse Birt runtime in Maven Central? I am also using JDK 11 (RedHat) and tried 4.13 and 4.14 without any error, but the data does not appear in the report (neith PDF nor Excel) though template View Report works fine. I have used siepkes' method and nexus and Maven to install the Eclipse Birt jars. I have been struggling with this for quite some time. Any advices would be highly appreiated!.

I wish the latest Eclipse Birt runtime be available in Maven Center.

davidwwd2011 commented 9 months ago

Or Do we need to make some code change to make it working again when upgrading Birt 4.4.2 to 4.13.0 or 4.14.0?