Bug 20660 - VM error viewing jar file on Ant classpath
Summary: VM error viewing jar file on Ant classpath
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2002-06-19 11:42 EDT by Adam Schlegel CLA
Modified: 2009-08-30 02:17 EDT (History)
2 users (show)

See Also:


Attachments
Error dialog generated (225.33 KB, image/bmp)
2002-06-19 11:43 EDT, Adam Schlegel CLA
no flags Details
Log file (4.08 KB, patch)
2002-06-19 11:43 EDT, Adam Schlegel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Schlegel CLA 2002-06-19 11:42:18 EDT
Build 20020619

Eclipse will consistently report a VM error after the following steps:
1) Start with 2 versions of the same jar file. (I used old and new versions of 
xalan.jar)
2) Create a project with the old version of the jar. Check it into CVS and 
version it (v1).
3) Replace the jar file with the new version and version it again (v2).
4) Add the new jar to Ant's classpath on the Ant preference page.
5) Run any Ant script.
6) Remove the jar from Ant's classpath.
7) On the project containing the jar, select Replace With->Version, and pick v1 
from the list of possibilities. This will load the old jar into the workspace.
8) Try to browse the jar in the packages view. This will cause the VM error.

The error does not occur unless an Ant script is run with the updated classpath.
Comment 1 Adam Schlegel CLA 2002-06-19 11:43:09 EDT
Created attachment 1510 [details]
Error dialog generated
Comment 2 Adam Schlegel CLA 2002-06-19 11:43:42 EDT
Created attachment 1511 [details]
Log file
Comment 3 Darin Swanson CLA 2002-10-30 11:34:31 EST
I can't reproduce the problem but this looks like a corrupt jar file problem 
(see bug 19537).

Moving to jdt core to see if they can / want / need to protect against this 
problem.
Comment 4 Philipe Mulet CLA 2002-11-06 02:24:45 EST
Catching Errors is usually not a good idea... 
Jerome - can you reproduce it and see if we can do anything reasonable?
Comment 5 Jerome Lanneluc CLA 2002-11-07 07:12:33 EST
I cannot reproduce either. However java.lang.InternalError is the symptom of a 
bug in the class library you're using. Even if the .jar file was corrupt, a 
ZipException should be thrown. You should report this error to your VM vendor.

Closing.
Comment 6 Jerome Lanneluc CLA 2002-11-07 08:59:08 EST
Reopening as a file descriptor on the internal jar is left open.
Comment 7 Jerome Lanneluc CLA 2002-11-07 10:27:58 EST
In the process of searching for classes to load, AntClassLoader opens the 
internal jar and leaves it open (until finalize is called). This prevents the 
jar to be replaced or to be deleted.

Moving back to Ant
Comment 8 Darin Swanson CLA 2002-11-12 21:58:45 EST
moving to M4
Comment 9 Darin Swanson CLA 2002-12-03 10:55:36 EST
We are no better or worse than any other plugin classloader (in fact we are 
just inheriting this behavior).

We are planning to add an option on the Ant launch configurations to discard / 
re-init the classloader on each launch (see bug 27440).  Currently the 
classloader is cached unless the classpath changes.

It is unlikely we will do any more on this issue. Comments?
Comment 10 Jerome Lanneluc CLA 2002-12-03 11:14:33 EST
Darin, isn't the problem that Ant runs in-process (as other plugins) but it has 
jars which are in the workspace on its classloader's classpath (and other 
plugins don't)?
Comment 11 Darin Swanson CLA 2002-12-03 11:26:58 EST
Yes this is what more readily exposes the problem to the user.

If you want to replace/delete the jar you will have to set to discard the ant 
classloader.

If you remove the jar from the ant classpath, the classloader will be discarded 
as well and then you can delete.
Comment 12 Darin Swanson CLA 2002-12-05 20:16:39 EST
Marking as a possible later.
Comment 13 Darin Swanson CLA 2004-08-26 12:59:16 EDT
Since builds occur by default in a separate VM, nothing more planned.
Comment 14 Denis Roy CLA 2009-08-30 02:17:43 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.