Bug 1016016 - Running console uninstaller more than once will corrupt uninstaller.jar
Summary: Running console uninstaller more than once will corrupt uninstaller.jar
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Installer
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Miles Tjandrawidjaja
QA Contact: Petr Kremensky
Russell Dickenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-07 10:18 UTC by Petr Kremensky
Modified: 2014-09-03 04:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-08 05:54:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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