eclipse-birt / birt

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

BIRT 4.15 rcp-designer: "XML Source"-tab of report not available (empty page due to NullPointerException, provider = null) #1589

Closed speckyspooky closed 6 months ago

speckyspooky commented 7 months ago

The rcp-designer version 4.15 milestone (Windows) is currently brooken according to #1588. The XML-source of a report isn't available (the page is gray) and there are NullPointerExceptions at the log-file. The problem of the reproducing is the same like #1588 only on the designer of master and my synced fork but not on my dev-env.

The NullPointers are:

Error 01

java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.texteditor.IDocumentProvider.getDocument(Object)" because "provider" is null at org.eclipse.ui.texteditor.MarkerRulerAction.getDocument(MarkerRulerAction.java:285)

Error 02

java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "org.eclipse.birt.report.designer.internal.ui.editors.rulers.EditorRulerLayout.getConstraint(org.eclipse.draw2d.IFigure)" is null at org.eclipse.birt.report.designer.internal.ui.editors.rulers.EditorRulerLayout.layout(EditorRulerLayout.java:57)

Log-File

log-2024-03-11.zip

XML-Source register

xml-source

merks commented 7 months ago

I could reproduce the one problem which I tried to fix like this:

image

But I don't know if it's correct. I'm not sure where to look to see what might be impacted.

The other problem I can't reproduce. I can see the document provider being set:

image

Might the one problem cause the other somehow?

speckyspooky commented 7 months ago

I thought the same fix to for the first option, but we have to check the effect on layout level, because at the version 4.14 be got directly position-values of that which are unequal 0.

The second issue is a good question. I will spend a little bit more time this evening.

merks commented 7 months ago

I will try to help out where I can within my ability to understand the frameworks. Certain for the getProvider() NPE I see the explicit and implicit providers being set so can't see why they would be null except if there are things happening after a dispose call...

speckyspooky commented 7 months ago

Update, with the last PR the Integer-cast-issue is solved but the document-provider issue is listed again together with another NullPointer:

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Control.setMenu(org.eclipse.swt.widgets.Menu)" because the return value of "org.eclipse.ui.forms.editor.IFormPage.getPartControl()" is null

Latest Log-file of the RCP-designer

log-file-20240312.zip

merks commented 7 months ago

In this code where the NPE happens:

image

It checks if the getPartControl() is null and if so creates one:

image

So it's kind of inconceivable that it can be null right after that. This is very confusing.

speckyspooky commented 7 months ago

With changed start configuration to start with the RCP-designer I got it reproduced locally. I added the following line: -product org.eclipse.birt.report.designer.ui.rcp.BIRT

RCP-start

But what is the difference to the all-in-one-designer that we got the issue(?)

merks commented 7 months ago

Even doing that I don't see the problem:

image

Normally one chooses the product here:

image

I recall mentioning in the past that BIRT has quite a few products and I don't understand their purpose:

image

Only two of them are "published" but I don't think anyone every clarified their purpose.

Products are just different combinations of installed bundles...

merks commented 7 months ago

Moreover, when I download and unzip the nightly build with the constraint NPE fix:

https://download.eclipse.org/birt/updates/nightly/N202403121254/downloads/birt-report-designer-all-in-one-4.15.0-202403121254-win32.win32.x86_64.zip

I also cannot reproduce the problem:

image

So I'm getting a bit suspicious about the nature of the problem. Might it be specific to the report you are opening?

speckyspooky commented 7 months ago

It is not specific on my report because I have the effect also with "new report" which are created with that RCP-version.

@merks Your screen above doesn't show the RCP-designer with the example-report on screen 2. This is the "all-in-one"-designer. It is for comparison between both versions right(?) But for testing of the nightly-build it would be better to use the RCP-zip-version.

The idea was from my side a little bit, can we change the RCP-configuration to avoid the error without further impact on RCP. I have checked the BIRT.poduction-files yesterday evening but I couldn't figure out a specific config which would help.

speckyspooky commented 7 months ago

I retested the nightly-build: https://www.eclipse.org/downloads/download.php?file=/birt/updates/nightly/N202403121254/downloads/birt-rcp-report-designer-4.15.0-202403121254-win32.win32.x86_64.zip

Result with the same error - attached the demo-report (a blank report): new_report.zip

2024-03-13 09_12_03-BIRT Report Designer RCP

merks commented 7 months ago

Even with exactly that, I cannot reproduce the problem:

image

This product is in pretty bad shape in general though...

speckyspooky commented 7 months ago

Hi Ed, to get the error you have to select the "XML Source"-tab. All other register works fine on my side.

speckyspooky commented 7 months ago

Latest update on it: in some special cases I can get an empty "XML Source"-tab also with the all-in-one-designer.

@merks You are able to see the empty "XML Source"-tab? I started debugging of the source according to you and can see that the document-provider of the page-editor is null -> crash. But no idea why this happens with the new 2024-03 and under 2024-06 too.

@wimjongman What do you think about this issue. For my it is an eclipse-framework issue but we have the problem at designer level. Yes, it is no longer a "RELEASE BLOCKER" but it is very confusing that to have an empty "XML Source"-tab for the users. Have you an idea or should we accept the topic as Know-Bug for our release 4.15...?

merks commented 7 months ago

The source tab works for me but the preview does not:

image

(These products are horribly defined with huge incomplete lists of bundles, i.e., if you say add required bundles it has more than 100, They are completely unmaintainable from my point of view.)

wimjongman commented 6 months ago

This new preview prototype should not be part of the release. It is incomplete.

speckyspooky commented 6 months ago

The question is more the common situatione with the "XML Source"-tab and the situation we have with the latest eclipse-platform changes. Together with your eclipse experiences if we can go ahead with the milestone-release or we can do something to solve the topics.

The "new preview prototype tab" is visible since 4.14 (I don't know where this has activated).

merks commented 6 months ago

I'm not sure the state of the progress here. I cannot reproduce the problem on Windows with the latest nightly build:

image

@speckyspooky

It's inexplicable to me that you can reproduce a problem with the same binary that I'm trying for which I cannot reproduce that problem...

speckyspooky commented 6 months ago

I have retested the nightly build and I get the following result:

4.15-RCP (eclipse platform 2024-03): error 01: Tab "XML Source" shows no content error 02: Tab "Preview Prototpye" shows no content

4.15-All-In-One (eclipse platform 2024-03): error 02: Tab "Preview Prototpye" shows no content

BIRT-dev-local-eclipse-master (my development machine, eclipse platform 2024-06): error 01: Tab "XML Source" shows no content

The both errors for each tab every time the 2 same errors.

error at -> Tab "XML Source":

java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.texteditor.IDocumentProvider.getDocument(Object)" because "provider" is null

error at -> Tab "Preview Prototpye"

java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Control.setMenu(org.eclipse.swt.widgets.Menu)" because the return value of "org.eclipse.ui.forms.editor.IFormPage.getPartControl()" is null

merks commented 6 months ago

FYI, the Preview Prototype tab was broken because of a bundle missing from the product. In particular, this class

https://github.com/eclipse-birt/birt/blob/03aec8a327bcdee038454c6b11349115170fe95b/UI/org.eclipse.birt.report.designer.ui.preview/src/org/eclipse/birt/report/designer/ui/preview/editors/ReportPreviewFormPage.java#L43-L64

can't create a report viewer without the contribution from the other bundle. To me this looks like a problem that has existed for a long time...

This leaves the empty XML Source tab that I can reproduce nowhere and apparently no one else is testing anything to provide additional information about whether they can or cannot reproduce that problem. I can make no problem in a problem I cannot reproduce....

speckyspooky commented 6 months ago

Hi Ed, for me it would be ok, to hide the "Preview Prototype" but I didn't know exactly where it can be hidden or remove. May be we can exclude it from the build-process.

And if nobody else has the issue with the "XML Source"-tab then it must be a special situation on my devices. So I have no problem if we have hidden the prototype to go ahead with the milestone.

merks commented 6 months ago

Note that I fixed the problem with the prototype tab.

So both tabs work in the all-in-one from https://download.eclipse.org/birt/updates/nightly/N202403241246

image

And also for the other product:

image

I'll start another milestone build.

@wimjongman

It would be great if at least one other person can confirm that these things work for them.

speckyspooky commented 6 months ago

@merks I have done the retest from my side.

The problem with the "New Preivew Prototype" is solved. Based on the nightly build All-In-One & RCP is fine!

The problem with the "XML Source"-tab is no longer reproducable on All-In-One. With the RCP-Version and a new created report directly from the nightly build I get again an empty "XML Source"-tab on MS Windows 11:

2024-03-24 15_03_11-BIRT Report Designer RCP

speckyspooky commented 6 months ago

@wimjongman According to Ed, has you the option to make a check/test from your side with the RCP-version under Windows. May be it is really only a local topic on my device.

merks commented 6 months ago

Your one comment about a "a new created reported" made me think what are all the ways to do that? Apparently there is a way to do that which doesn't involve creating a report in a project in the workspace but rather directly in the file system. which then uses a different mechanism to determine the document provider. In this case a ReportEditorInput is used as the editor's input, rather than IFileEditorInput, and that just isn't handled gracefully at all by the structure editor. Even if I try to hack in a document provider, the editor is not happy with that implementation (see error log warnings), though at least it shows some text:

image

This makes me really suspicious. So I tried this with the 4.14 release and I see both this problem and the design tab problem happen in the 4.14 release:

image

So indeed both these problem don't look new and in fact I am rather doubtful that either of these things worked correctly in the recent past, which makes me also wonder whether anyone actually normally cares.

doortokaos commented 6 months ago

I thought, perhaps you would appreciate some feedback. Unfortunately I can't contribute in programming a solution for this, but some spare time for a quick test was available.

I made a quick test with a simple new report containing a 3x3 grid with some labels, nothing fancy. I used

  1. https://www.eclipse.org/downloads/download.php?file=/birt/updates/milestone/S202403241344/downloads/birt-report-designer-all-in-one-4.15.0-202403241344-win32.win32.x86_64.zip and
  2. https://www.eclipse.org/downloads/download.php?file=/birt/updates/milestone/S202403241344/downloads/birt-rcp-report-designer-4.15.0-202403241344-win32.win32.x86_64.zip

In AllInOne (1.) the XML source tab and the new preview prototype work for me. In RCP (2.) the new preview prototype works for me but the XML source tab is broken. I think it is the already known error (shortened stack trace for reference):

java.lang.NullPointerException: Cannot invoke "org.eclipse.ui.texteditor.IDocumentProvider.getDocument(Object)" because "provider" is null
    at org.eclipse.ui.texteditor.MarkerRulerAction.getDocument(MarkerRulerAction.java:285)
    at org.eclipse.ui.texteditor.MarkerRulerAction.update(MarkerRulerAction.java:199)
    at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.update(AbstractRulerActionDelegate.java:130)
    ...

When help is needed, I can test another version as well.

wimjongman commented 6 months ago

Thank @doortokaos your help is much appreciated.

I also ran it. Apologies for the low response but I am tied to a customer project.

I tested the RCP and it is broken in many places. We cannot take that thing seriously. I think we can just drop that from the build. See below for some other weirdness in that product.

The all-in-one works fantastic.

Thanks for fixing the preview Ed @merks.

![image](https://github.com/eclipse-birt/birt/assets/180969/13fd99e4-e024-43bf-94d2-7a80503d33d0) ![image](https://github.com/eclipse-birt/birt/assets/180969/93535d2b-a7f8-4bb3-bf92-d1b5bd563ec1)
doortokaos commented 6 months ago

If you ask me, you could scrap the RCP Designer entirely. I always used the AIO, since I have plugins the need parts of the "normal" eclipse, but that might be a special case. 🤷‍♂️

I really don't know why the RCP even exists. In the "old days" I understood, that the file is smaller, and it is more preconfigured. Filesize differs on the above used nightly builds by ~3 MB...

And concerning pre-configuration: I only noticed, that I have to choose a workspace manually in AIO, in RCP it is automatically chosen... Perhaps there are more differences, but at a first glance, they elude me.

But that's just my 2 cents...

merks commented 6 months ago

FYI, I am removing the RCP product via this PR:

https://github.com/eclipse-birt/birt/pull/1606

speckyspooky commented 6 months ago

The RCP is now offline.