Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311110 - Profiling with an incorrect path creates a Java failure to launch dialog
Summary: Profiling with an incorrect path creates a Java failure to launch dialog
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2003
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Mike Reid CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: post472
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 16:45 EDT by Joel Cayne CLA
Modified: 2016-05-05 10:53 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Cayne CLA 2010-04-29 16:45:54 EDT
Using TPTP-4.7.0-201004281900, create a new Profile Launch configuration. In the Main tab enter a path that is incorrect for the Class file.

Using Java 6 (64-bit on Windows x86_64) it prints to the console:
Exception in thread "main" java.lang.NoClassDefFoundError: StartStop
Caused by: java.lang.ClassNotFoundException: StartStop
	at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:320)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
In addition, a dialog appears on the machine running the Agent Controller with "Could not find the main class. Program will exit." for every launch.

For Java 5 it only prints to the console "The java class is not found: StartStop".
Comment 1 Mike Reid CLA 2010-05-05 13:49:12 EDT
This behaviour comes as a side-effect of the fix implemented for bug 308169. In order to the read output stream of the launched process without any character conversion occurring, the javaw.exe executable needs to be used instead of java.exe.

I had another look at CreateProcess and through the docs and experimentation I was unable to find a way to launch java.exe while retaining the ability to read the raw output stream. Similary I was unable to find a way to somehow block the ability of javaw.exe to open message dialog windows as it does in JVM 1.6.

At present it is unclear if we can correct this behaviour without compromising the fix for bug 308169.
Comment 2 Mike Reid CLA 2010-05-13 15:53:07 EDT
With more investigation there are some ways we can deal with this, but none are low-cost and so we will need to push this out to a future release.

Some of the options include:

- Write a custom JVM launcher using JNI invocation interface
- Examine console output for the 'telltale' missing main message:
"Exception in thread "main" java.lang.NoClassDefFoundError: StartStopNew
- Finally, on the AC side we can try and detect a well-defined state of the JVM where we can be sure this happened and kill the process (which closes the message dialog). e.g. interrogate the JVM for running threads and if all are stopped we kill the process. 

There are pros and cons in all of these that need to be further investigated when this is looked at again.
Comment 3 Mike Reid CLA 2011-01-07 11:39:10 EST
From the above options the only robust solution is the first; however it adds an unnecessary burden to future maintenance and so given the low impact of this issue it does not seem an appropriate use of resources.

Looking at this behaviour again, there are two mitigating factors:

1) On the workbench side, the agent appears to be running still; the process can be terminated from the workbench as normal and this dismisses the window on the remote machine.

2) If the user does not notice that the agent is still running, from observation it appears that by closing the workbench the remote process is terminated as well, dismissing the window.

With these in mind it seems unlikely this will be encountered frequently if at all. However it is worth documenting this in the event that it is discovered.

Pushing out from 4.7.2 to address documentation in future.
Comment 4 Kathy Chan CLA 2011-03-23 16:33:22 EDT
No plan to fix.
Comment 5 Joel Cayne CLA 2011-03-28 11:58:01 EDT
Closing.