eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[OCLInEcore] Editor unusable in Luna SR1 #1412

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 452162 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Nov 18, 2014 13:20 EDT | | Modified | Nov 24, 2014 10:41 EDT | | Reporter | Adolfo Sanchez-Barbudo Herrera |

Description

Louis pointed me out a problem which I've been able to reproduce.

Installation: Luna Modelling SR1 + OCL Examples.

Steps:

If I install the complete Xtext SDK afterwards, I can't reproduce the NPE.

The error log indicates that the issue is related to Xtext code. Without further investigation I presume that, we are missing some Xtext plugin/s - present when installing the SDK- which, without it/them, is causing us some bad behaviour. That's quite weird though, because any plugin we need should appear as a dependency in the generated code of our editors. Perhaps that's new bit, and our editors haven't been regenerated ?

Anyway it's just speculation, it needs investigation...

I'll also try to reproduce in Luna SR0.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 18, 2014 13:22

Created attachment 248736 Screenshot with NPE

clipboard.png

clipboard.png

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 18, 2014 13:28

Created attachment 248737 Luna SR0 Installation Details

I can't reproduce this in Luna SR0

clipboard.png

clipboard.png

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 18, 2014 13:32

Created attachment 248738 Luna SR1 details

If I uninstall Xtext SDK feature, I obtain the exceptions again

clipboard.png

clipboard.png

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 18, 2014 13:45

Workaround rechecked: Install "Xtext Complete SDK".

I suggest an announce in the forum and a note in the new & noteworthy wiki page.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 18, 2014 15:32

Not critical. I've never seen it and there is an SDK workaround.

It is not clear what version is actually a problem. Your only details are for OCL 5.0.0 which was superseded by 5.0.1 pre-release.

You'll see plenty of reconciler errors with Xtext so it is imperative to pin the versions down.

It is very undesirable to announce every eccentric annoyance on the forum.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 18, 2014 16:16

Hi,

I strongly disagree.

You and myself didn´t notice it because we need Xtext SDK to develop.

I was told by a user who wanted to use the editor and he didn´t because it was unusable. I didn´t know any workaround: I had to investigate because at a first point it worked for me, and when I reproduced it, I had to figure out which one of the configurations of my Luna setup was what made the editor work again. End users are not so benevolent, they are either plenty-of-times users who try to notify the bug and/or figure out a straightforward workaround, or they revert back to the previous version waiting for a fix for SR2... which who knows if it will arrive giving your light reaction.

I´ll investigate the problem in my own. Given we are talking about one of the key features of the project, we can´t afford to have the problem again in Luna SR2.

(In reply to Ed Willink from comment #5)\

It is not clear what version is actually a problem. Your only details are for OCL 5.0.0 which was superseded by 5.0.1 pre-release.

Not sure what confussed you. There are some clues in the description:

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #0)\

Installation: Luna Modelling SR1 + OCL Examples.

Luna Modelling SR0 + OCL examples: the editor works.\ Luna Modelling SR1 + OCL examples: the editor does NOT work.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 04:04

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #6)

Installation: Luna Modelling SR1 + OCL Examples.

Luna Modelling SR0 + OCL examples: the editor works. Luna Modelling SR1 + OCL examples: the editor does NOT work.

A problem like this needs precise versions. Luna SR1 is suggestive but does not make clear exactly which OCL, Xtext, Xtend-Lib, EMF, Platform versions are involved. Luna SR0 is vague since we had OCL 5.0.1 immediately. Xtext versions also move out of synchronism with the simrel, so is Luna SR1, Xtext 2.7.2 or 2.8.0? Does your workspace permit 'contact all sites?' to contact inappropriate contributions?

The original report suggested Xtext SDK was a workaround. I'm not clear quite what that means in terms of versions and plugins.

Also ensure that the repro does not have extraneous projects. See the OCL newsgroup "Re: Differences evaluating an OCL expression using Interactive OCL Console and xText Interactive Console. Is ther a bug?" message where it appears that probably Sirius 1.0.0, possibly Epsilon, possibly ??? is able to corrupt the operation of the Xtext OCL console.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 06:17

Hi,

[I had already sent screenshoots with the installation details >.<]

My apologies. I thought it was straightforward.

When I mention "Luna Modelling SR1 + OCL examples" I mean:

If you needed some numbers, you might have a look to the screenshots I attached yesterday.

When I mentioned install "Xtext Complete SDK" I meant:

I'll attach a new screenshot for the setup with the workaround, which hopefully will help...

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 06:21

Created attachment 248747 Luna SR1 + workaround installation details

clipboard.png

clipboard.png

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 07:13

Created attachment 248752 Bad configuration log

The repro

Unzip eclipse-modeling-luna-SR1-win32-x86_64.zip Install New Software from the default luna repo for OCL Examples and Editors Restart New Project, Examples, OCLinEcotre tuturial edit a couple of characters, NPE stack trace below

Configuration Log attached

An internal error occurred during: "XtextReconcilerJob".

java.lang.NullPointerException at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.getResourceDescriptionManager(DirtyStateEditorSupport.java:496) at org.eclipse.xtext.ui.editor.DirtyStateEditorSupport.announceDirtyState(DirtyStateEditorSupport.java:466) at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.postParse(XtextDocumentReconcileStrategy.java:160) at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.doReconcile(XtextDocumentReconcileStrategy.java:146) at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:65) at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(XtextReconciler.java:401) at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(XtextReconciler.java:386) at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:327) at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:1) at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36) at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:418) at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:131) at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:324) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

:notepad_spiral: bad.log

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 07:18

Created attachment 248754 OK configuration log

Indeed. Installing "Xtext Complete SDK" causes the problem to go away.

Corresponding confuguration log attached.

:notepad_spiral: ok.log

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 07:28

The workaround adds

Features:\ org.eclipse.xtend.sdk (2.7.2.v201409160908) "Xtend IDE"\ org.eclipse.xtext.docs (2.7.2.v201409160908) "Xtext Documentation "\ org.eclipse.xtext.sdk (2.7.2.v201409160908) "Xtext "\ org.eclipse.xtext.ui (2.7.2.v201409160908) "Xtext UI Core "\ org.eclipse.xtext.xbase (2.7.2.v201409160908) "Xbase Model "\ org.eclipse.xtext.xbase.lib (2.7.2.v201409160908) "Xbase Runtime Library"\ org.eclipse.xtext.xtext.ui (2.7.2.v201409160908) "Xtext Xtext UI "

Plugins:\ org.eclipse.emf.mwe2.language (2.7.0.v201409021051) "Modeling Workflow Engine 2 Language" [Starting]\ org.eclipse.emf.mwe2.language.ui (2.7.0.v201409021051) "Modeling Workflow Engine 2 Language UI" [Starting]\ org.eclipse.emf.mwe2.launch (2.7.0.v201409021051) "Modeling Workflow Engine 2 Launch" [Resolved]\ org.eclipse.xpand (2.0.0.v201406030414) "Xpand Core" [Resolved]\ org.eclipse.xtend.core (2.7.2.v201409160908) "Xtend Core" [Starting]\ org.eclipse.xtend.doc (2.7.2.v201409160908) "Xtend Documentation" [Starting]\ org.eclipse.xtend.examples (2.7.2.v201409160908) "Xtend Examples" [Starting]\ org.eclipse.xtend.ide (2.7.2.v201409160908) "Xtend IDE" [Starting]\ org.eclipse.xtend.m2e (2.7.2.v201409160908) "Xtend m2e Integration" [Resolved]\ org.eclipse.xtend.standalone (2.7.2.v201409160908) "Xtend Standalone Bundle" [Resolved]\ org.eclipse.xtend2.lib (2.7.2.v201409160908) "Old Xtend 2 lib (Deprecated, use org.eclipse.xtend.lib instead)" [Resolved]\ org.eclipse.xtext.activities (2.7.2.v201409160908) "Xtext UI Activities" [Resolved]\ org.eclipse.xtext.builder.standalone (2.7.2.v201409160908) "Xtext Standalone Builder" [Starting]\ org.eclipse.xtext.common.types.shared (2.7.2.v201409160908) "Common Types Shared State" [Active]\ org.eclipse.xtext.common.types.shared.jdt38 (2.7.2.v201409160908) "Common Types Shared State (JDT 3.8)" [Resolved]\ org.eclipse.xtext.doc (2.7.2.v201409160908) "Xtext Documentation" [Starting]\ org.eclipse.xtext.ecore (2.7.2.v201409160908) "Xtext Ecore Support" [Active]\ org.eclipse.xtext.generator (2.7.2.v201409160908) "Xtext Generator" [Starting]\ org.eclipse.xtext.junit (2.7.2.v201409160908) "Xtext Junit Support (Deprecated, use org.eclipse.xtext.junit4 instead)" [Resolved]\ org.eclipse.xtext.junit4 (2.7.2.v201409160908) "Xtext Junit4 Support" [Resolved]\ org.eclipse.xtext.logging (1.2.15.v201409160908) "Xtext log4j fragment" [Resolved]\ org.eclipse.xtext.m2e (2.7.2.v201409160908) "Xtext m2e Integration" [Resolved]\ org.eclipse.xtext.purexbase (2.7.2.v201409160908) "org.eclipse.xtext.purexbase" [Starting]\ org.eclipse.xtext.purexbase.ui (2.7.2.v201409160908) "org.eclipse.xtext.purexbase.ui" [Starting]\ org.eclipse.xtext.ui.codetemplates (2.7.2.v201409160908) "Xtext Ecore Ui Support" [Starting]\ org.eclipse.xtext.ui.codetemplates.ui (2.7.2.v201409160908) "Xtext Ecore Ui Support" [Starting]\ org.eclipse.xtext.ui.ecore (2.7.2.v201409160908) "Xtext Ecore Ui Support" [Active]\ org.eclipse.xtext.ui.junit (2.7.2.v201409160908) "Xtext Junit UI Support" [Starting]\ org.eclipse.xtext.ui.shared (2.7.2.v201409160908) "Xtext UI Shared" [Active]\ org.eclipse.xtext.xbase (2.7.2.v201409160908) "Xbase Model" [Starting]\ org.eclipse.xtext.xbase.junit (2.7.2.v201409160908) "Xbase Junit support" [Resolved]\ org.eclipse.xtext.xbase.ui (2.7.2.v201409160908) "Xbase UI" [Active]\ org.eclipse.xtext.xtext.ui (2.7.2.v201409160908) "Xtext Xtext UI" [Starting]\ org.eclipse.xtext.xtext.ui.examples (2.7.2.v201409160908) "Xtext Examples" [Starting]\ org.eclipse.xtext.xtext.ui.graph (2.7.2.v201409160908) "Xtext Railroad Diagram Plugin" [Starting]

shared or lib are most likely to have hidden dependencies.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 07:30

The method which causes the exception is deprecated in Mars:

/**

The replacement now does a check, so NPE are not sent anymore (at least at that point):

/**

I've not checked if there is similar fix backported to Luna. More importantly, what changed to suddenly make the problem appear in Luna SR1 ?...

Time to download Xtext Git repo.... I guess that now you are looking at this, let me know if you want me to go further or just you want to go on the investigations.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 07:56

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #13)

The method which causes the exception is deprecated in Mars:

return resourceServiceProviderRegistry.getResourceServiceProvider(resourceURI). get(DirtyStateResourceDescription.Manager.class);

I've not checked if there is similar fix backported to Luna. More importantly, what changed to suddenly make the problem appear in Luna SR1 ?...

The workaround clearly arranges for resourceServiceProviderRegistry.getResourceServiceProvider(resourceURI) to not return null.

Once we understand how to encourage that we can make the problem go away.

One option is to have dependencies on whichever Xtext plugins solve the problem.

Another option is a custom resourceServiceProviderRegistry that doesn't return null.

Possibly the problem is a confusion between .ecore and .ecore.oclas and *.oclinecore URIs.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 08:02

Bug 298601 looks very smelly.

"Manager manager = resourceServiceProvider.getResourceDescriptionManager();

we have a NullPointerException.

In my opinion the builder should not care about non Xtext resources."

Maybe installing more of Xtext converted a 'non-Xtext' resource to an Xtext one.

Adolfo: If you're already set up to see the NPE, can you tell what the resourceURI was?

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 08:24

(In reply to comment #15)\

Adolfo: If you're already set up to see the NPE, can you tell what the resourceURI was?

.ecore . The one corresponding to the file which is edited.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 08:36

(In reply to comment #16)

(In reply to comment #15)

Adolfo: If you're already set up to see the NPE, can you tell what the resourceURI was? .ecore . The one corresponding to the file which is edited.

might xbase the SDK component which makes .ecore resource be an "Xtext resource".

Things pending to discover:\ a) What changed in Xtext in SR1 to make the issue arise.\ b) Check if the issue is already fixed for SR2.

I could quickly check b) by adding the maintenance repo URI and update my SR1 + OCL Examples installation. For a) I'd need to download Xtext GIT repo and further investigation. I'll start with the former

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 08:45

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #17)

(In reply to comment #16)

(In reply to comment #15)

Adolfo: If you're already set up to see the NPE, can you tell what the resourceURI was? .ecore . The one corresponding to the file which is edited.

might xbase the SDK component which makes .ecore resource be an "Xtext resource".

Sort of. The two scenarios differ with respect to the availability of a *.ecore registration for the org.eclipse.xtext.resource.impl.ResourceServiceProviderRegistryImpl$InternalData.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 19, 2014 09:13

org.eclipse.xtext.ui.ecore is where the plugin extension point is that would declare *.ecore.

Simplest fix is probably to define an org.eclipse.ocl.examples.xtext.oclinecore.ui dependency on org.eclipse.xtext.ui.ecore and let P2 sort out the rest.

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 09:29

I presume that Xtext 2.7.3 (at least) will be the contribution for Luna SR2.

What I did:

I presume we don't have to do anything to have this fixed for Luna SR2. Perhaps:

[1] https://www.eclipse.org/modeling/tmf/downloads/

[Coincidentally, Xtext 2.7.3 was released today]

eclipse-ocl-bot commented 2 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 19, 2014 09:32

Created attachment 248757 Installation details of the working setup

clipboard.png

clipboard.png

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Nov 24, 2014 10:41

Fixed in 5.0.3 which provides an explicit import for the org.eclipse.xtext.ui.ecore plugin whose registration avoids the NPE.

No fix needed for Mars since the bug is also fixed in Xtext 2.7.3/2.8.0 so no rational Mars installation should be affected.