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

No Output to Console in small app // Output to Console is less then command line output, when app finishes (JDK related) #71

Closed paulvi closed 9 years ago

paulvi commented 11 years ago

Not all goes to Console View when app finishes.

Example (coffeescript)

util = require('util')
console = require('console')
log5node = require('./lib/log5node')

debuglogger = log5node.getCreateLogger('debug')
util.debug util.inspect debuglogger
console.log "App debugged\n"
debuglogger.log "App debugged\n"

In this snippet debuglogger gets undefined value. In command line there is error, that is not displayed in Console View

TypeError: Cannot call method 'log' of undefined at Object. (D:\Workspaces\workspace

paulvi commented 10 years ago

The simplest way to reproduce is 1 line script justlog.js :

console.log("just console.log");

It will not produce output in Eclipse Console.

paulvi commented 10 years ago

I have spent some time debugging org.nodeclipse.debug.launch.LaunchConfigurationDelegate.java, that gave no direct result

    Process p = DebugPlugin.exec(cmds, workingPath, envp);
    RuntimeProcess process = (RuntimeProcess)DebugPlugin.newProcess(launch, p, Constants.PROCESS_MESSAGE); // no way to get private p.handle from java.lang.ProcessImpl

When debugging launch justlog.js, there is output; when running justlog.js in debugged Eclipse without breakpoints, once again there is output.

Then just searching "no output from launched process in Eclipse", lead me to

Indeed this is a race condition. As soon as monitored process has terminated, program closed pipes. The data consumer didn't not know about that and tried to read already closed streams (the data that had been not not grabbed yet, just was lost). This is an issue of the tandard streams control: the owner, not just spawner should be responsible for their closing.

Summary (is there output from justlog.js):

While recommendation will be to use Eclipse 32 versions, some more information is required from users on different environments (other OSes). Leave the issue open.

paulvi commented 10 years ago

OK, at least with x64 bit JDK 1.8.0_05 on Windows 7, the issue does not appear

nodeclipse-on-1 8_05

paulvi commented 9 years ago

closing as not appearing in the latest JDK