Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
speckyspooky opened this issue Mar 11, 2024 · 29 comments
Labels
BugFix Change to correct issues RELEASE BLOCKER Blocks the nearest release
Milestone

Comments

@speckyspooky
Copy link
Contributor

speckyspooky commented Mar 11, 2024

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
Copy link
Contributor

merks commented Mar 12, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor

merks commented Mar 12, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor

merks commented Mar 12, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor

merks commented Mar 13, 2024

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
Copy link
Contributor

merks commented Mar 13, 2024

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
Copy link
Contributor Author

speckyspooky commented Mar 13, 2024

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
Copy link
Contributor Author

@merks
Copy link
Contributor

merks commented Mar 13, 2024

Even with exactly that, I cannot reproduce the problem:

image

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

@speckyspooky
Copy link
Contributor Author

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

@speckyspooky
Copy link
Contributor Author

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

@speckyspooky speckyspooky changed the title BIRT 4.15 rcp-designer: XML-source of report not available, internal erros: 2 NullPointerExceptions BIRT 4.15 rcp-designer: "XML Source"-tab of report not available (empty page due to NullPointerException, provider = null) Mar 16, 2024
@merks
Copy link
Contributor

merks commented Mar 16, 2024

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
Copy link
Contributor

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

@speckyspooky
Copy link
Contributor Author

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
Copy link
Contributor

merks commented Mar 17, 2024

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
Copy link
Contributor Author

speckyspooky commented Mar 20, 2024

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 added a commit to merks/birt that referenced this issue Mar 24, 2024
The preview tab cannot work without the contribution from bundle
org.eclipse.birt.report.designer.ui.preview.static_html so that bundle
should be included in features and products that include
org.eclipse.birt.report.designer.ui.preview.

eclipse-birt#1589
merks added a commit that referenced this issue Mar 24, 2024
The preview tab cannot work without the contribution from bundle
org.eclipse.birt.report.designer.ui.preview.static_html so that bundle
should be included in features and products that include
org.eclipse.birt.report.designer.ui.preview.

#1589
@merks
Copy link
Contributor

merks commented Mar 24, 2024

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

private static final String VIEWER_ID = "org.eclipse.birt.report.designer.ui.preview.static_html"; //$NON-NLS-1$
/** The stale type */
private int staleType;
/** The form editor */
private FormEditor editor;
/** The report viewer */
private final IViewer reportViewer;
/**
* Creates <code>ReportPreviewFormPage</code>
*
* @throws FrameworkException if occurs error when create viewer
*/
public ReportPreviewFormPage() throws FrameworkException {
super();
ViewerExtensionManager manager = (ViewerExtensionManager) Platform
.createFactoryObject(ViewerExtensionManager.VIEWER_EXTENSION_MANAGER_ID);
reportViewer = manager.createViewer(VIEWER_ID);

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
Copy link
Contributor Author

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
Copy link
Contributor

merks commented Mar 24, 2024

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
Copy link
Contributor Author

@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
Copy link
Contributor Author

@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
Copy link
Contributor

merks commented Mar 24, 2024

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
Copy link

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
Copy link
Contributor

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

image

@doortokaos
Copy link

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
Copy link
Contributor

merks commented Mar 25, 2024

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

#1606

@speckyspooky
Copy link
Contributor Author

The RCP is now offline.

merks added a commit to merks/birt that referenced this issue Mar 26, 2024
Use a subclass of
org.eclipse.birt.report.designer.internal.ui.editors.ReportEditorInput
that implements org.eclipse.ui.IStorageEditorInput.
Also guard against stack overflow from
ReportEditorInput.getAdapter(Class).

eclipse-birt#1589
merks added a commit that referenced this issue Mar 26, 2024
Use a subclass of
org.eclipse.birt.report.designer.internal.ui.editors.ReportEditorInput
that implements org.eclipse.ui.IStorageEditorInput.
Also guard against stack overflow from
ReportEditorInput.getAdapter(Class).

#1589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFix Change to correct issues RELEASE BLOCKER Blocks the nearest release
Projects
None yet
Development

No branches or pull requests

4 participants