Nodeclipse / nodeclipse

Nodeclipse-1 : Eclipse plugin for Node.js, PhantomJS development (Nodeclipse core plugin); Maven and Gradle (with Android) plugins
https://nodeclipse.github.io/
158 stars 78 forks source link

Preference->Nodeclipse and Nod.js project cause EclipseUI to freeze #204

Closed IHEST closed 6 years ago

IHEST commented 8 years ago

I have eclipse Mars 4.5.1. I have installed the Enide2015 installed in multiple ways : http://dl.bintray.com/nodeclipse/nodeclipse/1.0.2f/ and using the market place. My node.exe is in a different folder than where the workspace is located. I have specified the PATH user variable to point to that directory and was trying to do that on eclipse using window->preference-> Nodeclipse. However, the Eclipse UI freezes.

My OS is Windows10 - 64 bit. Searched this site, StackOverflow and Eclipse site , could not find anything. Here is the JSTACK dump: Attaching to process ID 3012, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.51-b03 Deadlock Detection:

No deadlocks found.

Thread 0: (state = IN_NATIVE)

IHEST commented 8 years ago

Eclipse UI freezes when I create a new Node.JS project.

IHEST commented 8 years ago

Java Version 1.8.0_51 Eclipse 4.5.1(Build Id 20150924-1200) NodeEclipse-EnideStudio2015 RAM - 8GB OS: Windows10 64bit Processor -i5-4200U 2.3 GHZ

IHEST commented 8 years ago

Eclipse ini xms256m xmx1024m

paulvi commented 8 years ago

This is too much information given. If it is about freezes in newest Eclipse, you should try different version to compare. Have you tried on Eclipse 4.5.0?

Ask on Stackoverflow as advised on http://nodeclipse.org/#support

paulvi commented 8 years ago

A way of installing Nodeclipse plugins does not matter, as long as you get latest version .

Check in Help -> Installation Details

IHEST commented 8 years ago

I already have raised the issue in Stack overflow (http://stackoverflow.com/questions/35583462/nodeeclipse-on-eclipse-mars ) and https://bugs.eclipse.org/bugs/show_bug.cgi?id=488326

IHEST commented 8 years ago

I think the issue is with Thread0 - since when I create a new Node.js project or check thee preference on Nodeeclipse - it has the same call stack :

org.eclipse.core.internal.preferences.AbstractScope.getNode(java.lang.String) @bci=28, line=38 (Compiled frame)
org.eclipse.core.runtime.preferences.DefaultScope.getNode(java.lang.String) @bci=2, line=76 (Compiled frame)
org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences() @bci=8, line=238 (Compiled frame)
org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(boolean) @bci=25, line=269 (Compiled frame)
org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(java.lang.String) @bci=7, line=419 (Compiled frame)
org.eclipse.ui.preferences.ScopedPreferenceStore.getBoolean(java.lang.String) @bci=2, line=359 (Compiled frame)
org.eclipse.jface.preference.BooleanFieldEditor.doLoad() @bci=15, line=149 (Interpreted frame)
org.eclipse.jface.preference.FieldEditor.load() @bci=13, line=502 (Interpreted frame)
org.eclipse.jface.preference.FieldEditorPreferencePage.initialize() @bci=49, line=306 (Interpreted frame)
org.nodeclipse.ui.preferences.NodePreferencePage.initialize() @bci=1, line=213 (Interpreted frame)
org.eclipse.jface.preference.FieldEditorPreferencePage.createContents(org.eclipse.swt.widgets.Composite) @bci=72, line=231 (Interpreted frame)
paulvi commented 8 years ago

OK

Have you tried on Eclipse 4.5.0? e.g. trying in Enide 2015 https://sourceforge.net/projects/nodeclipse/files/

IHEST commented 8 years ago

Did not work with 4.5.0. same issue,

IHEST commented 8 years ago

Here is what all combinations I tried: 1) Eclipse Mars 4.5.0 + Enide 2015 2) Eclipse Luna SR2 + Enide 2015 3) Eclipse Luna SR2 + Enide 2014 All of these caused UI freeze in both condition: a) create a Node.JS package and b) Click on Windows->Preferences->Nodeclipse All other preferences works without UI freeze. Based on that, I\ would think this a Nodeclipse plugin issue**. Eclipse Luna reduces heap default heap size range 40 MB- 512 MB , compared to Eclipse Mars 256MB-1024MB. Having said that task manager for eclipse still shows under 500 MB, so it is not case of too many plugins. All of these are fresh installs with just Enide plugins. The way I am circumventing this issue is like what I did yesterday: a) I start eclipsec.exe, this starts the console b) then I click either the preference or New Node.js project c) UI freezes d) I click Ctrl + Break, UI comes back.. I had copied in the earlier comment the call stack that I see in console. or you can refer to my eclipse bug link where i have attached

IHEST commented 8 years ago

Official confirmation from Eclipse folks that it is Nodeclipse issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=488326#c3

paulvi commented 8 years ago

First, it works for me. Just tried now on Windows with Neon beta.

The code is in this base, and it was not changed for a year, no many Nodeclipse have not report freezes before. https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java

And you don't even know that Enide 2015 is downlodable package, so you can't install it into Eclipse Mars, you only can install plugins of specific version, and only latest version is default.

Isn't Thread0 UI thread?

Have you tried on Eclipse 4.5.0? e.g. trying in Enide 2015 That is download that package and run it.

@IHEST You need to learn much more. The only thing you did on GitHub is raising this issue. Don't expect other people to rush to help you. Also first time Nodeclipse user, I guess. Please read more sections on http://www.nodeclipse.org/

For me it started as research, I appreciate people who come here to share their knowledge and some work effort results.

IHEST commented 8 years ago

Listen you p*ss face, no need to take this personally and abuse people. You can't help to fix it, that is fine , I will use something else. There is no need to be abusive, maybe you are socially retarded. Now if you want to claim it is not an issue that is fine. Apparently, Eclipse folks thinks otherwise https://bugs.eclipse.org/bugs/show_bug.cgi?id=488326#c5 So good luck with your miserable life

IHEST commented 8 years ago

From : https://marketplace.eclipse.org/content/enide-studio-2015-nodejs-javascript-java-and-web-tools "Unless there is the latest version download for your OS, recommended install via drag-n-drop of Install image onto Eclipse main toolbar" - which is what I did .

On the other hand , you have totally different instruction mentioned here- which is download the Zip file http://www.nodeclipse.org/enide/2015/README_2015-7

From the comment section: Steven R. Loomis • 8 months ago Is it possible to install Enide 2015 into Eclipse Mars? • Reply•Share › Avatar Paul_Verest Mod Steven R. Loomis • 8 months ago Yes.

Do you need Gradle IDE pack? Do you need Node.js? All JavaScript tools? Do you have Eclipse for Java or Java EE Developers?

Depending on what actually you features want and Eclipse flavor it may be 30 to 50 plugins. And for Enide Studio 2014 it was already too slow from my experience when having 20-30 plugins in a list. Also it was unclear what are optional.

The update site that actually has all of that is http://www.nodeclipse.org/upda... But I even didn't try to measure how long it takes to read all content.

Maybe a remedial English course is in order.

paulvi commented 8 years ago

OK, this is intense experience. I am sorry to seem rude. I am quite humble person if you could ever meet me in person.

Have you tried on Eclipse 4.5.0? e.g. trying in Enide 2015 package https://sourceforge.net/projects/nodeclipse/files/

Thinking over I do bet that primary cause is your workstation environment configuration, e.g. node on path or not, node location

And interestingly I do recognize myself in your behavior several years ago, when I was raising issues to all bugs I ran into, and work on finding cause. (And could not understand others reaction) You are the best user. Yes, if you go to a Start-up gathering, they say the users that complain are 100x times better those who just say only Thank you.

I will look at Eclipse bug when I have time (and it is my personal time I need to spend for it), so if you really want this to be fixed please read the 1 source .java In my experience it takes much more time to recreate environment and test the issue, then actually check code and fix it. I am ready to help with how to debug this one Eclipse plugin with org.nodeclipse.ui id

Nice to meet you. Really.

Best regards, Paul Verest http://www.nodeclipse.org/ http://szjug.github.io/

IHEST commented 8 years ago

No worries. it's all good. I am also looking at this on my spare time which is not much with 2 young kids. I looked at the code on the initializer, here are the things that I found: a) Node.exe in my case is NOT under programfiles/nodejs/, that is what you first look for , then you seem to look for based on what is in PATH variable. I have already set that up correctly, before I raised the SO , eclipse and Node eclipse report. b) You seem to look for Express , Coffee and typescript in Appdata/roaming/ ... I don't have these folders. Background-I have downloaded the EnideStudio2015 and unziped the files . c) Based on JSTACK when it is freezing, it seems like the issue is line 183 - 200 of https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java Maybe this points to what the issue is. Here is what I got from JSTACK , the relevant portion.

IHEST commented 8 years ago

Btw, ProcessUtils.exec is called from initializeDefaultPreferences(line 115-135) via getCurrentVersionOf in https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java.

As I mentioned in one of the spots - maybe in Eclipse bug report , I do not have folders: /AppData/Roaming/npm/node_modules/" + "express/bin/express" /"coffee-script/bin/coffee"/ "typescript/bin/tsc", is that supposed to be created as part of Enide 2015 install?

Latest checks: Anyway, I went ahead and did a global install of express, coffee-script and typescript, now they are in Appdata/Roaming/npm/node_modules,

-ProcessUtils.exec uses the ProcessBuilder class to get input stream and error streams- do you know the command that it is trying to execute? getNodePath- seems to get the value of NODE_PATH, I have already set this to point o Node.exe directory and

getCurrentVersionOf- get the version of express, coffe-script and typescript, is that correct? cmdLine.add(getNodePath()); cmdLine.add(nodeAppPath); cmdLine.add("--version");

Also, wondering what your java version is? My version is 1.8.0_60

IHEST commented 8 years ago

I checked what I think are the process execution for getCurrentVersionOf in CMD for express-generator and express: 1) C:\Development\nodejs\node.exe C:\Users....\AppData\Roaming\npm\node_modules\express-generator\bin\express --version : came back with 4.13.1

2) C:\Development\nodejs\node.exe C:\Users....\AppData\Roaming\npm\node_modules\express\bin\express --version . This gave an error.

Now if you look at the , line 205 https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java if there is an error ,

the error stream is send back, which would be tried to set in line 131 in method initializeDefaultPreferences in https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java

IHEST commented 8 years ago

I had a chance to do some more digging in, on CMD: a) C:\Development\nodejs\node.exe C:\Users\..\AppData\Roaming\npm\node_modules\express-generator\bin\express -- version: 1.4.13

b)C:\Development\nodejs\node.exe C:\Users\...\AppData\Roaming\npm\node_modules\express\bin\express --version: returns an error

I went back and looked at the method exec, line 250 in https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java returns an error string if there is an error stream , which in turn will be tried to set in line 132 in method

initializeDefaultPreferences , in https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java. Unless I am missing something, that is going to cause an issue. Btw, I have installed express, but the file I think it is looking for is not there . This is the instruction http://www.nodeclipse.org/updates/ I followed

paulvi commented 8 years ago

Do you know how to debug Eclipse plugin?

You just need to import one project org.nodeclipse.ui. Then Debug as -> Eclipse Application (It should be inside Enide 2015, IDE for JEE developers or IDE for Eclipse commiters, that have PDE plugins)

paulvi commented 8 years ago

As per logic, I don't know.

Long ago we just wrote at http://www.nodeclipse.org/updates

$ npm install -g nodeclipse
$ npm install -g express
$ npm install -g express-generator

as installation steps before installing Nodeclipse plugins themselves. Now for a case when express is not there, should we try to find it every time. Or do it only one time and make (very likely first time user) to select pathes manually.

paulvi commented 8 years ago

As for express bundled inside Eclipse

https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L127-L133

well, it was done by @tomotaro1065 long time ago, and I think it was not good idea, because express may have a lot and changing dependencies.

paulvi commented 8 years ago

@IHEST Take a look at https://guides.github.com/features/mastering-markdown/

I have updated your comments above to make them more readable.

paulvi commented 8 years ago

Also from https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L187 there's reminder about #158

IHEST commented 8 years ago

Thanks for updating comments and the link. I was using that Link on the tool bar, replaced the placeholder URL -but the text portion in angular brackets was left out .My bad, I wanted to check the markdown-but didn't get to it.

As far as searching express , express generator, typescripts , here are some thoughts: 1) Is that really a dependency if a person just wants to use Node.js project ? I have not looked at the entire code , you are more familiar with it. 2) if it really is a dependency, and

getCurrentVersionof

is used to get the versions (of express, typescript and coffeescript) then why not make that a manual process via environment variables or batch file execution? Batch file contains all the npm installs. Having said that, there maybe reasons not do the batch file route.

3) Another option is why not exit gracefully? if you don't get what you want in a few minutes have process.waitFor( long timeout,Time Unit u) , then give a message on the console can't find express or express-generator or whatever? Same thing when you have an error stream.

Hope you don't take this personally, please take this as a constructive suggestion:

As an aside, one of the things I find challenging is Documentation. I think the documentation is really confusing the way it has been written; maybe it is me , but I think landing page Nodeclipse is confusing, if you clicked on one of download links. Either have a link with all the pre-reqs (Node.js,express, typescript.. ) and environment variable set up as the initial steps before the download. Make it more like a recipe, so that it is hard to screw up.

This is especially important when you are just trying to do something which is not directly related to creating express projects or throw a small prototype, last thing I want to do is spent google for 2 days and find all the different requirements. I spend good 2 days, before I even put the question on SO and raised the bugs. It was 2 days I could have really used to learn something more to upskill rather than trying to learn how to install a software. I am more interested in programming than trying to find all the different places the information has been spread out . I have the same critique with books, where people just write 800 pages- half of it is repetition or fluff. But, then maybe it is just me...

IHEST commented 8 years ago

Also checking the versions each time a project is created, or when Preference->Nodeclipse is selected,is that really necessary??

IHEST commented 8 years ago

debug1-preferenceinitializer-118

debug2-processutils java-171

debug3-processutils java-190

IHEST commented 8 years ago

The while loop never exits on debug, whereas on CMD.exe same command comes back.

paulvi commented 8 years ago

1) Is that really a dependency (about Express)

It should not really be, as this issue has showed.

Also checking the versions each time a project is created, or when Preference->Nodeclipse is selected,is that really necessary??

If the property is empty, it is uninitialized. And Eclipse will try to initialize again. As as remember.

Where exactly is this?

paulvi commented 8 years ago

So this issue is when express is not installed?

Please create more issue for other topics, this thread is too large already.

IHEST commented 8 years ago

Express is installed. But the input stream reading does not exit-this is where it happens: https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java#L190-L193

IHEST commented 8 years ago

Express -generator is also installed , it is in express generator version check https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/preferences/PreferenceInitializer.java#L118-L119 which calls the while loop fails https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java#L190-L193

As you can see the Express-generator is installed , in the right path that it looks for: express-generator

Also, I have trimmed the JSTACK dump in the initial thread,so it is easy to find where the loop issue is

paulvi commented 8 years ago

OK, so ProcessUtils should never cause infinitive loop https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.ui/src/org/nodeclipse/ui/util/ProcessUtils.java#L190-L193 this is bug. Do you have a solution for this?

paulvi commented 6 years ago

There were no any other reports about UI freeze during almost 2 years.

Closing as old, similar to #213