Bug 1016016 - Running console uninstaller more than once will corrupt uninstaller.jar
Running console uninstaller more than once will corrupt uninstaller.jar
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Installer (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Miles Tjandrawidjaja
Petr Kremensky
Russell Dickenson
Depends On:
  Show dependency treegraph
Reported: 2013-10-07 06:18 EDT by Petr Kremensky
Modified: 2014-09-03 00:56 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-08 01:54:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Kremensky 2013-10-07 06:18:20 EDT
Description of problem:
 Starting -console uninstallation more than once will corrupt uninstaller.

Version-Release number of selected component (if applicable):
 EAP 6.2.0.ER4

How reproducible:

Steps to Reproduce:
 1. Install EAP to ${target}.
 2. Navigate to ${target}/Uninstaller folder
 3. - java -jar uninstaller.jar -console 
    - Force the deletion of /home/pkremens/EAP-6.2.0 [y/n] n
    - java -jar uninstaller.jar -console 

Actual results:
 There are two scenarios I hit.
 a) Error: Unable to access jarfile uninstaller.jar
 b) Gui uninstaller is started with:
[pkremens@dhcp-4-200 ~]$ java -jar EAP-6.2.0/Uninstaller/uninstaller.jar -console
 Force the deletion of /home/pkremens/EAP-6.2.0 [y/n] n
/home/pkremens/EAP-6.2.0/Uninstaller/uninstaller.jar (No such file or directory)
java.io.FileNotFoundException: /home/pkremens/EAP-6.2.0/Uninstaller/uninstaller.jar (No such file or directory)
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:215)
	at java.util.zip.ZipFile.<init>(ZipFile.java:145)
	at java.util.jar.JarFile.<init>(JarFile.java:153)
	at java.util.jar.JarFile.<init>(JarFile.java:132)
	at com.izforge.izpack.uninstaller.SelfModifier.extractJarFile(SelfModifier.java:548)
	at com.izforge.izpack.uninstaller.SelfModifier.invoke(SelfModifier.java:435)
	at com.izforge.izpack.uninstaller.Uninstaller.main(Uninstaller.java:109)
Unable to exec java as a subprocess.
The uninstall may not fully complete.
[pkremens@dhcp-4-200 ~]$ java -jar EAP-6.2.0/Uninstaller/uninstaller.jar -console
Error: Unable to access jarfile EAP-6.2.0/Uninstaller/uninstaller.jar

Expected results:
 Force the deletion of /home/pkremens/EAP-6.2.0 [y/n]

Additional info:
 I was able to reproduce this also with 6.1.1.GA installer, so this is not a regression.
Comment 1 Miles Tjandrawidjaja 2013-10-07 13:53:57 EDT
The uninstaller.jar should not be able to run more than once.
After running uninstaller.jar the jar itself will be deleted.

The message
"Error: Unable to access jarfile uninstaller.jar"
is expected since the uninstaller.jar no longer exists.

[mtjandra]> java -jar nofile.jar
Error: Unable to access jarfile nofile.jar

The second scenario occurs when you try to run the uninstaller.jar as it is being removed. There is some sort of lock that doesn't allow the program to delete itself, so it spawns a replica, during this time the uninstaller.jar has been deleted which is why you get a FileNotFoundException.

Choosing the force the deletion adds a -f flag.
Hope this helps.
Comment 2 Petr Kremensky 2013-10-08 01:54:03 EDT
Hi Miles, my mistake here. My problem here was that I could start gui uninstaller more time,but -console only once, but for some reason I didn't realized that running console uninstaller will actualy delete it (switched "Force the deletion" message to "Quit" from gui in my mind).

Thanks for clarification. Closing as NOTABUG.

Note You need to log in before you can comment on or make changes to this bug.