Giter Site home page Giter Site logo

Comments (19)

hvbtup avatar hvbtup commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.

wimjongman avatar wimjongman commented on July 20, 2024

you have to build in the birt directory.

from birt.

hvbtup avatar hvbtup commented on July 20, 2024

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.

wimjongman avatar wimjongman commented on July 20, 2024

Older versions have to be run with JDK8.

from birt.

hvbtup avatar hvbtup commented on July 20, 2024

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.

wimjongman avatar wimjongman commented on July 20, 2024

Can you run 'mvn clean package -DskipTests' manually from the root dir?

from birt.

hvbtup avatar hvbtup commented on July 20, 2024

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.

wimjongman avatar wimjongman commented on July 20, 2024

Yes, it is a mismatch. They must be the same.

from birt.

hvbargen avatar hvbargen commented on July 20, 2024

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.

wimjongman avatar wimjongman commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.
image

from birt.

hvbargen avatar hvbargen commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

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.

hvbargen avatar hvbargen commented on July 20, 2024

Created PR #644

from birt.

wimjongman avatar wimjongman commented on July 20, 2024

Thanks, @hvbargen!

from birt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.