Comments (19)
I can say that this NPE does not occur with the BIRT version from https://github.com/hvbtup/birt which I built on 20200804 (where I originally fixed this and took the patch from).
So the reason must be in the differences between this version and the current eclipse/birt.
from birt.
Debugging this is quite hard and time-consuming, particularly because I don't know how I could debug without calling mvn package (takes ~30min here), extract the 240 MB ZIP all-in-one, then start it and run the test report.
What I could find out so far by adding some debug messages in drawBorder is:
In the first call to PageDeviceRender::drawBorder, the expression tb.rowBorders.get( tb.tableLRY ) returns null, which causes the NPE, while String.valueOf(tb.rowBoders) looks like this:
{-31015=org.eclipse.birt.report.engine.layout.emitter.TableBorder$Border@604e6493, -34015=org.eclipse.birt.report.engine.layout.emitter.TableBorder$Border@54e7f03}
from birt.
The source code (eg TableBorder.java) is an undocumented mess, unfortunately, for example: It is normal that the keys in the map are negative? I don't know. One can only guess the purpose of most classes. I'll create a toString() method for TableBorder and see if this helps.
BTW if I add if-statements to handle the null border case, then the report doesn't fail, but the page-breaking is different: The yellow text is on the first page then instead of causing a page-break.
from birt.
I narrowed this down a bit by testing the report with several older BIRT releases.
With BIRT 4.3.0, 4.4.0, 4.5.0, 4.6.0 the rendered PDF is looking wrong (like I said https://bugs.eclipse.org/bugs/show_bug.cgi?id=562873).
With BIRT 4.7.0 I get the NPE.
So obviously this bug was introduced with BIRT 4.7.0.
That means I only have to look at the commits from ~ 1 year between june 2016 and june 22, 2017.
from birt.
What I wanted to do is binary searching for the exact commit which introduced the NPE bug.
But I cannot build older versions myself.
For example, if I call
cd birt
git checkout 7d46aaaf5730dc312915c84492f60ce62eb5fbbe
cd ..
build (which sets up environment vars and calls mvn package -DskipTests)
then this results in a lot of errors like
[FATAL] Non-resolvable parent POM for org.eclipse.birt.build:org.eclipse.birt.build-parent:0.0.1-SNAPSHOT: Could not find artifact org.eclipse.birt:org.eclipse.birt-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 10
Any ideas what to do here?
What I wanted to do is binary searching for the exact commit which introduced the NPE bug.
from birt.
you have to build in the birt directory.
from birt.
I know, and that's what my build.cmd script (located inside parent directory of birt) does, and the script is working fine with the current head:
setlocal
set JAVA_HOME=D:\prog\jdk8
set PATH=D:\prog\apache-maven-3.6.3\bin;%JAVA_HOME%\bin;%PATH%
pushd birt
mvn clean package -DskipTests
popd
endlocal
from birt.
Older versions have to be run with JDK8.
from birt.
I know, and my script takes care of that. Maybe some GIT-ignored artifacts (from a build with the head revision) are still around and cause trouble. I'll try from scratch this weekend.
from birt.
Can you run 'mvn clean package -DskipTests' manually from the root dir?
from birt.
Same result.
I also tried with a clean directory (I deleted everything except .git, then git checkout 7d46aaa, then git restore, then build.
Still same result.
I don't know about POM, P2 etc, but maybe this is wrong thrEoughout the whole project in this earlier version:
birt\model\pom.xml says:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.birt</groupId>
<artifactId>org.eclipse.birt-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
...
And birt\pom.xml says:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.birt</groupId>
<artifactId>org.eclipse.birt-parent</artifactId>
<version>4.6.0-SNAPSHOT</version>
<packaging>pom</packaging>
...
Isn't this a version mismatch 4.6.0 <-> 0.0.1 ?
from birt.
Yes, it is a mismatch. They must be the same.
from birt.
That was a good tip, but this now results in another build error.
I replaced <version>0.0.1-SNAPSHOT</version>
with <version>4.6.0-SNAPSHOT</version>
in all pom.xml files with the help of a good editor, then tried to build again.
Now I have
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'eclipse' from location http://download.eclipse.org/eclipse/updates/4.6milestones/: No repository found at http://download.eclipse.org/eclipse/updates/4.6milestones. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'eclipse' from location http://download.eclipse.org/eclipse/updates/4.6milestones/
It seems as if the whole build process was (or still is) broken somehow.
It shouldn't be that damn hard to compile BIRT based on an older commit.
from birt.
You are talking 2016. I'm surprised if any of the old repositories still exist. If you click that link you will see that it has moved to an archive location.
from birt.
I could narrow it down to commit f84d0f8 "Do not use specified height but actual height if row is empty to avoid endless page break".
For a test, I reverted the changes from commit f84d0f8 in file org\eclipse\birt\report\engine\nLayout\area\impl\TableLayout.java.
Now the test report is working as expected - without a NullPointerException. The second page looks like this.
from birt.
I only wonder why the current BIRT head reacted with a NPE whereas when I fixed the very same bug in my fork (see hvbtup@b8de757), BIRT reacted with a wrong layout.
But anyway...
I'll create a PR soon.
from birt.
I tested that my fix (reverting an old commit) worked with the with the example report from https://bugs.eclipse.org/bugs/show_bug.cgi?id=562873.
But after I merged the latest changes, created a new branch "pr_issue_636" and performed the same little change again, I can no longer use the generated report-all-in-one IDE.
HTTP ERROR 503
Problem accessing /viewer/preview. Reason:
Service Unavailable
It seems like I'm hitting issue #621 or #620 (but I'm on Windows).
I'll create a PR nevertheless.
from birt.
Created PR #644
from birt.
Thanks, @hvbargen!
from birt.
Related Issues (20)
- Excel, error on file opening when large column-width used at tables-/grid-definition HOT 1
- BIRT-designer/Nightly Build 4.16.0-202405152028, Report invisible & error on opening of reports - GraphicalEditorWithFlyoutPalette.getGraphicalViewer() throws NPE HOT 12
- Query text: enhance syntax highlighting to support more the sql standard data types HOT 2
- Sorting Column Bindings HOT 3
- Enhance the SQL-DataSet-Editor with a search option - see #1584 HOT 8
- BIRT 4.15 can't be used under Eclipse RAP HOT 4
- Can't generate Excel file: Could not auto-size column. Make sure the column was tracked prior to auto-sizing the column. HOT 1
- Getting NoSuchmethodError: "TTFReader.loadTTF" after updating BIRT runtime 4.10 to 4.15 HOT 1
- Errors in reports when upgrading BIRT Runtime from 4.10 to 4.15 HOT 2
- Expression Builder, Column Binding, sorting option - add additional sort option "Sort descending" HOT 1
- How can i fix this ReportServiceException HOT 2
- scripted data source 数据集只加载一次
- Out of memory error when creating a chart HOT 58
- Where is "null value" check box parameter in debug mode ??? 4.14 HOT 3
- 4.17 Releng HOT 1
- Use edge as default browser and use modern help HOT 3
- Show the DataView when a new report is created
- body/label/text-property is not localized in XLSX output HOT 4
- Excel, Apache POI 5.2.3 - PageMargin is changed to a new parameter list of methods HOT 1
- Excel, image scaling is wrong when only one image dimension is set HOT 1
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.