Bug 21294 - issue more appropriate message when workbench already running
Summary: issue more appropriate message when workbench already running
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 19718 21346 21891 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-08 05:27 EDT by Kathy Endres CLA
Modified: 2004-12-05 09:45 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Endres CLA 2002-07-08 05:27:33 EDT
I started the workbench, did some other things, then forgot had already started 
the workbench and started it again.

An Eclipse window appeared saying, 
"Problems during startup.  Check the ".log" file in the
".metadata" directory of your workspace.
Here's what appeared in the .log file in the .metadata directory:


!SESSION ----------------------------------------------------------------------
!ENTRY org.eclipse.core.launcher 4 0 Jul 07, 2002 19:31:48.849
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.reflect.InvocationTargetException: 
java.lang.reflect.InvocationTargetException: 
org.eclipse.core.runtime.CoreException: 
The platform metadata area is already 
in use by another platform instance, or there was a failure
in deleting the old 
lock file.  If no other platform instances are running, delete the 
lock file 
(C:\Documents and Settings\endres\My 
Documents\IBM\wsad\workspace\.metadata\.lock) and try starting the platform 
again.
	at 
org.eclipse.core.internal.runtime.InternalPlatform.createLockFile(InternalPlatfo
rm.java:209)
	at 
org.eclipse.core.internal.runtime.InternalPlatform.loaderStartup(InternalPlatfor
m.java:560)
	at java.lang.reflect.Method.invoke(Native Method)
	at 
org.eclipse.core.internal.boot.InternalBootLoader.startup(InternalBootLoader.jav
a:909)
	at 
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:76
8)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:248)
	at org.eclipse.core.launcher.Main.run(Main.java:698)
	at org.eclipse.core.launcher.Main.main(Main.java:534)

NOTE: I was expecting a more appropriate message and no exception to get
thrown in the .log file.
Comment 1 John Arthorne CLA 2002-07-08 14:53:44 EDT
*** Bug 21346 has been marked as a duplicate of this bug. ***
Comment 2 John Arthorne CLA 2002-07-09 11:06:03 EDT
One alternative to consider: don't show any warning/error dialog at all, and 
exit silently.  This would have the result that trying to launch a second 
instance would just do nothing.  Some other applications (VA/Java, Notes) seem 
to take this approach.
Comment 3 John Arthorne CLA 2002-07-25 10:05:21 EDT
*** Bug 21891 has been marked as a duplicate of this bug. ***
Comment 4 DJ Houghton CLA 2002-08-08 12:41:33 EDT
Investigate and see if we can do something for 2.0.1.

2 options: display a message to the user or do nothing (as John suggests above)

Option 1: display message
For displaying a message to the user, look at InternalBootLoader.run().

We might be able to catch the CoreException which is being thrown by 
InternalPlatform and (based on severity, plugin-id, and error codes) determine 
that the error is because we are already running another platform and we could 
return an integer constant to Main.

Note that displaying a message to the user would require work in the executable 
by SWT.

Option 2: do nothing

This would require the catching of the exception as described above. We would 
still want to log a message though, in case the user is in a weird state in 
which they don't have another platform launched but for some reason they still 
have the lock file around. They would need to know the reason that we aren't 
starting up and the location of the lock file to delete.
Comment 5 DJ Houghton CLA 2002-08-15 17:04:28 EDT
Unfortuanatly due to visibility we cannot use CoreExceptions to indicate to the 
BootLoader that there is a problem.

Code already exists in Main which calculates the log file location and the lock 
file is a sibling. Investigate putting the lock file check in Main.
Comment 6 Kevin Cornell CLA 2002-08-16 08:59:54 EDT
The changes to the launcher have been made to support option 1. When the JVM 
(Main) returns an exit code of 15, the following message is displayed and then 
the launcher exists:

Another session is already running in the associated workspace.
If this is not the case, please delete the ".lock" file in the
workspace ".metadata" directory and try starting the platform again.

Grant, you can rebuild the launchers.
Comment 7 Grant Gayed CLA 2002-08-19 14:09:07 EDT
I've rebuilt and released the launchers for all platforms, to both the 2.0.1 
and 2.1 streams.
Comment 8 DJ Houghton CLA 2002-08-20 11:57:34 EDT
Fixed and released into both 2.0.1 and 2.1 streams.
Comment 9 John Arthorne CLA 2002-09-03 16:49:48 EDT
*** Bug 19718 has been marked as a duplicate of this bug. ***
Comment 10 Konyeth Atlandis Lee CLA 2004-12-05 09:45:07 EST
Fail to open Eclipse: 
 
"Problems during startup. Check the ".log" file in the ".metadata" dirctory of 
your workspace." 
 
My system is: 
 
XFree86:XFree86-4.3.0,1  
jdk:jdk-1.4.2p6_4  
eclipse:eclipse-2.1.3_1  
 
!SESSION ---------------------------------------------------------------------- 
!ENTRY org.eclipse.core.launcher 4 0 ??? 05, 2004 20:32:03.17 
!MESSAGE Exception launching the Eclipse Platform: 
!STACK 
java.lang.reflect.InvocationTargetException 
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
	at java.lang.reflect.Method.invoke(Method.java:324) 
	at org.eclipse.core.launcher.Main.basicRun(Main.java:291) 
	at org.eclipse.core.launcher.Main.run(Main.java:747) 
	at org.eclipse.core.launcher.Main.main(Main.java:583) 
Caused by: java.lang.reflect.InvocationTargetException 
	at 
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:861) 
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:468) 
	... 7 more 
Caused by: 
java.lang.UnsatisfiedLinkError: /usr/local/eclipse/plugins/org.eclipse.swt.gtk_2.1.3/os/freebsd/x86/libswt-pi-gtk-2136.so: /usr/local/eclipse/plugins/org.eclipse.swt.gtk_2.1.3/os/freebsd/x86/libswt-pi-gtk-2136.so: 
ELF file OS ABI invalid 
	at java.lang.ClassLoader$NativeLibrary.load(Native Method) 
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) 
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1469) 
	at java.lang.Runtime.loadLibrary0(Runtime.java:788) 
	at java.lang.System.loadLibrary(System.java:834) 
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:108) 
	at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:19) 
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:482) 
	at org.eclipse.swt.widgets.Display.create(Display.java:469) 
	at org.eclipse.swt.graphics.Device.<init>(Device.java:111) 
	at org.eclipse.swt.widgets.Display.<init>(Display.java:303) 
	at org.eclipse.swt.widgets.Display.<init>(Display.java:299) 
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1361) 
	at 
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) 
	... 8 more