osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Injector errors break AADL Navigator & Editor in standard oomph deployment #949

Closed bisc closed 6 years ago

bisc commented 6 years ago

Summary: I am trying to update my OSATE2 dev build to Eclipse Oxygen, but the standard setup of OSATE2 crashes when I try to open AADL files or use the Navigator. (None of that took place in Eclipse Neon 4.6.3 with OSATE 2.2.2.)

Setup:

(Actually I tried manually installing a minimal set of packages, like xtext 2.12, on a different copy Eclipse Oxygen, and the same errors as below showed up, so I wouldn't blame the oomph script -- this version or in general.)

Steps to reproduce issues:

  1. Run org.osate.branding as an Eclipse Application in a fresh/empty workspace.
  2. Open the AADL navigator view.
  3. Open any predefined aadl file in Plugin_Contributions. This leads to the editor crashing with the following trace (null ptr that seems to originate from an injector-populated variable): editor-propertyset-issue-stacktrace.txt
  4. Close the Eclipse App and start it again. This leads to a huge stack trace issue-injectors-in-oxygen-stacktrace3.txt that can be summarized by these excerpts: Error in custom provider, java.lang.NullPointerException [...] com.google.inject.CreationException: Guice creation errors: [...] java.lang.RuntimeException: Failed to create injector fororg.osate.xtext.aadl2.properties.Properties [...] Failed to create injector for org.osate.xtext.aadl2.properties.Properties [...] Failed to create injector for org.osate.xtext.aadl2.Aadl2
  5. The Eclipse App runs, but the AADL navigator is broken and non-interactive, as in this screenshot:

issue-with-injectors-in-oxygen-screenshot

I wonder if I missed a necessary manual change in terms of injection when updating to OSATE2.3.0 or Eclipse Oxygen.

bisc commented 6 years ago

Tried the same build of Oxygen on an older commit (409dc092480eec6ce3c685d8bcaa3496d6c23071, Sep 12), got same erroneous behavior.

I also know that OSATE commit 274b1ced2 (Jul 31) does NOT have this behavior with Eclipse Neon 4.6.3.

lwrage commented 6 years ago

What do you mean by "The only seemingly relevant system package is Google Guice version 4.0."? Also, did you use the eclipse installer to install oxygen as described on osate.org?

bisc commented 6 years ago

Re Guice, I noticed that my system has 4.0 installed, and the latest version is 4.1. If you all are using 4.1, it is plausible that these issues might be because of 4.0. (It's not trivial for me to update it now, so I didn't experiment.)

I was downloading the modeling tools version directly from here and doing import->oomph->projects into workspace (then I put the oomph file URL from osate.org). Let me try the installer (didn't realize they had one for linux too) and report on that.

lwrage commented 6 years ago

I'm concerned about the system package part. Xtext uses guice 3.0. You need to make sure that guice 4.0 is not visible to osate, e.g., it shouldn't be installed in jre/lib/ext.

bisc commented 6 years ago

Thanks for pointing this out. Looks like my system's guice is sitting in /usr/share/java and is not visible to eclipse's version of java (which sits in /usr/lib/jvm). Furthermore, if I dig into e.g. org.osate.xtext.aadl2 in the package explorer, I can see com.google.inject_3.0.0.v201312141243.jar under the Plugin Dependencies -- and no guice under JRE System Library. So things seem in order here. Had Eclipse been linking to a wrong Guice, it would've been an issue on Neon as well.

I did the installer procedure exactly as described on osate.org. Getting exactly the same behavior and errors on this version too :(

lwrage commented 6 years ago

The NPE should go away as soon as you close all open editors and create an AADL project.

bisc commented 6 years ago

Indeed! Whenever the previous session ended without editors, all the behavior is normal. But should I leave any editor open while closing Eclipse, the injector exceptions come up in the next launch.

Thanks for looking into this. The issue is more isolated than I thought, but I'll still wait to update till this is resolved.

lwrage commented 6 years ago

As soon as you have an AADL project in the workspace it is no longer necessary to close the editors. The error only occurs when you open a contributed file in an empty workspace.

bisc commented 6 years ago

That's not the behavior I'm seeing.

npe-nonempty-workspace

npe-nonempty-workspace-aadlnavigator

lwrage commented 6 years ago

I see a NoClassDefFoundError, so this looks like a different issue. Does this also happen on a fresh workspace if you create an AADL project before trying to open a contributed aadl file?

bisc commented 6 years ago

That may or may not be a different issue, but those NoClassDefFounds occurred all the way along the various setups that I've tried. There is a bunch of them in stacktrace3.txt that I've posted in the original issue text. I am pretty used to seeing that with ContributedAadlStorage by now.

Just tried fresh workspace->create project->create file->open file->close eclipse->open eclipse. Same errors with long exception logs; here's the new tracefile (looks pretty much the same to me) issue-injectors-in-oxygen-stacktrace4.txt

lwrage commented 6 years ago

I have a fix for one NPE that causes the text editor to crash when there is no project in the workspace. That's the only issue I could reproduce. I suspect that your development setup is somehow messed up. You could try to start from scratch: Delete eclipse, workspaces, and maybe also cloned git repos. Delete directories named *.oomph.* in $HOME/.eclipse/ to get rid of any cached information. Delete the bundle pool $HOME/.p2; or create a new bundle pool in the installer if you have other eclipse installation that use the existing bundle pool. Then run the installation steps again.

bisc commented 6 years ago

These are good steps, didn't know where cached bundles were. Unfortunately, even with a fresh bundle pool, deleted .eclipse, and a new installer, I'm having the same errors.

I'm going to try it on a different system and report back. Thanks for your help so far!

bisc commented 6 years ago

Surprisingly, I managed to reproduce this bug in a completely new OS (Ubuntu 17.04 x64) & hardware setup. Here's how it goes:

  1. Download the installer, run the standard installation script. Close all projects other than in osate2-core.
  2. Open eclipse, make a project and a file in it, test opening-closing (everything worked well at this point).
  3. In osate2-core, do git checkout 2.3.0-RELEASE and git reset --hard.
  4. Rebuild grammar artifacts, clean all projects.
  5. After this, the same old errors show up, with opening saved editors and the AADL navigator.
  6. Going back to latest develop doesn't help, the errors persist. I'm trying to make fresh workspaces now, with removing bundle pools and oomph cache, and checking out fresh repos, but it doesn't even build now: errors with resolving org.eclipse.jdt.core and several classes (AbstractAadl2SemanticSequencer, AbstractAadl2SyntacticSequencer, AbstractAadl2ProposalProvider).

I wonder if this procedure would reproduce the errors -- and if there is more external state to the eclipse/osate installation that I'm failing to delete.

lwrage commented 6 years ago

You cause the issue by closing too many projects. Open at least org.osate.ge and org.osate.ge.diagram.

bisc commented 6 years ago

Wow, you're right! Opened most GE projects and the errors went away, on both platforms.

It is quite surprising though that there is some implicit dependency from core to GE. Perhaps it could be called out in the docs...

Thanks so much for your help! Feel free to close.