Bug 1016016

Summary: Running console uninstaller more than once will corrupt uninstaller.jar
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: InstallerAssignee: Miles Tjandrawidjaja <mtjandra>
Status: CLOSED NOTABUG QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: mtjandra, thauser
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 05:54:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2013-10-07 10:18:20 UTC
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:
 always

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 17:53:57 UTC
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.

Example:
[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 05:54:03 UTC
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.