Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 99526 - Class folders are being treated as archive files causing exceptions
Summary: Class folders are being treated as archive files causing exceptions
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-12 03:51 EDT by Venkatesh Prasad Ranganath CLA
Modified: 2005-06-20 09:18 EDT (History)
0 users

See Also:


Attachments
An example workspace that causes the error (112.24 KB, application/octet-stream)
2005-06-18 17:36 EDT, Venkatesh Prasad Ranganath CLA
no flags Details
An example workspace that causes the error (112.24 KB, application/octet-stream)
2005-06-18 17:37 EDT, Venkatesh Prasad Ranganath CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Venkatesh Prasad Ranganath CLA 2005-06-12 03:51:31 EDT
The following exception occurs for every folder mentioned in the classpath of
the debug configuraiton.

!MESSAGE Unable to access archive
/home/venku/projects/Testing/JavaSlicer/Slicer/Throw
!STACK 0
java.util.zip.ZipException: Is a directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:112)
        at java.util.zip.ZipFile.<init>(ZipFile.java:72)
        at
org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils.getZipFile(SourceLookupUtils.java:67)
        at
org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer.getArchive(ExternalArchiveSourceContainer.java:193)
        at
org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer.findSourceElements(ExternalArchiveSourceContainer.java:79)
        at org.eclipse.debug.core.sourcelookup.containers.CompositeS
Comment 1 Venkatesh Prasad Ranganath CLA 2005-06-12 03:55:21 EDT
When a breakpoint is hit during the debug session, the mentioned exception occurs.
Comment 2 Venkatesh Prasad Ranganath CLA 2005-06-12 04:04:24 EDT
The exact version of eclispe is 3.1RC2.  This exception does not occur on 3.1RC1.
Comment 3 Darin Wright CLA 2005-06-14 11:33:56 EDT
I'm not able to reproduce this problem. Where is the class folder added to te 
classpath - i.e. from the build path, from the launch config class path, or 
the launch config source path (all work for me).
Comment 4 Venkatesh Prasad Ranganath CLA 2005-06-14 19:47:41 EDT
Well, I created a new debug session with no source attachments.  Not even in the
projects.  I added a folder to the class path via "advanced->add external
folder" and it generated the following entry in the .launch file.

<listEntry value="&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry type=&quot;2&quot;
path=&quot;3&quot; externalArchive=&quot;/home/
venku/projects/Testing/JavaSlicer/Slicer/Home&quot;/&gt;&#10;"/>

However, when trying to view the source it printed out the following into the
log file.

!SUBENTRY 1 org.eclipse.debug.core 4 120 2005-06-14 18:39:27.385
!MESSAGE Source lookup error
!SUBENTRY 2 org.eclipse.debug.core 4 120 2005-06-14 18:39:27.386
!MESSAGE Unable to access archive
/home/venku/projects/Testing/JavaSlicer/Slicer/Home
!STACK 0
java.util.zip.ZipException: Is a directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:112)
        at java.util.zip.ZipFile.<init>(ZipFile.java:72)
        at
org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils.getZipFile(SourceLookupUtils.java:67)
        at
org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer.getArchive(ExternalArchiveSourceContainer.java:193)
        at
org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer.findSourceElements(ExternalArchiveSourceContainer.java:79)
        at
org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:78)
        at
org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:45)
        at
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant.findSourceElements(AbstractSourceLookupParticipant.java:67)
        at
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:126)
        at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038)
        at org.eclipse.core.runtime.Platform.run(Platform.java:775)
        at
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:461)
        at
org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:711)
        at
org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.lookup(SourceLookupFacility.java:138)
        at org.eclipse.debug.ui.DebugUITools.lookupSource(DebugUITools.java:658)
        at
org.eclipse.debug.internal.ui.views.launch.LaunchView$SourceLookupJob.run(LaunchView.java:176)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


After this run, I installed 3.1RC1 on top of 3.1RC2 and the debug session worked
fine.  In fact, it even worked with "variable string" based classpaths defying
the (unfixed) bug 77773.
Comment 5 Darin Wright CLA 2005-06-15 16:14:52 EDT
Fixed in JavaSourceLookupUtil and PackageFragmentRootSourceContainer. 
Incorrectly creating archive source containers for folders/directories.
Comment 6 Darin Wright CLA 2005-06-15 16:15:54 EDT
Please verify, Kevin.
Comment 7 Kevin Barnes CLA 2005-06-15 16:44:39 EDT
verified
Comment 8 Venkatesh Prasad Ranganath CLA 2005-06-18 17:14:37 EDT
I tried 3.1RC3 and the fix worked but it did result in a new failure.  The
source files in the project are not being found.  I turned on the debug flags
via .options file and only the following archives were searched for the source
file when a breakpoint was reached.  The source lookup path was set by using the
"Restore default".

[reading    java/io/PrintStream.class]
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/rt.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/rt.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/rt.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/sunrsasign.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/sunrsasign.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/sunrsasign.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/jsse.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/jsse.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/jsse.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/jce.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/jce.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/jce.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/charsets.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/charsets.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/charsets.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/ext/sunjce_provider.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/ext/sunjce_provider.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/ext/sunjce_provider.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/ext/dnsns.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/ext/dnsns.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/ext/dnsns.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/ext/ldapsec.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/ext/ldapsec.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/ext/ldapsec.jar
Thread[Worker-17,5,main] OPENING class file Test.class [in <default> [in
/usr/local/jdk1.4.2/jre/lib/ext/localedata.jar [in test]]]
(Thread[Worker-17,5,main]) [JavaModelManager.getZipFile(IPath)] Creating ZipFile
on /usr/local/jdk1.4.2/jre/lib/ext/localedata.jar
(Thread[Worker-17,5,main]) [JavaModelManager.closeZipFile(ZipFile)] Closing
ZipFile on /usr/local/jdk1.4.2/jre/lib/ext/localedata.jar


Comment 9 Venkatesh Prasad Ranganath CLA 2005-06-18 17:36:47 EDT
Created attachment 23509 [details]
An example workspace that causes the error
Comment 10 Venkatesh Prasad Ranganath CLA 2005-06-18 17:37:21 EDT
Created attachment 23510 [details]
An example workspace that causes the error

I have removed a .index file as that was 6MB.
Comment 11 Venkatesh Prasad Ranganath CLA 2005-06-18 19:02:58 EDT
I tried to debug and found something weird in
org.eclipse.debug.internal.core.sourcelookup.containers.ContainerSourceContainer.findSourceElements(String)

At line 121 in ContainerSourceContainer.java

osFile="/home/venku/workspace/installations/eclipse/workspace/test/Test.java"
canonicalPath="/workspace/installations/eclipse/workspace/test/Test.java"
canonicalSegments="[workspace, installations, eclipse, workspace, test, Test.java]"
workspacePath="workspace/installations/eclipse/workspace/test/Test.java"

Subsequent invocation fRoot.findFilesForLocation(workspacePath) at line 121
returns an empty array as there is no such location as mentioned by workspacePath.

On my Linux box I start eclispe with "eclipse -data
/home/venku/workspace/eclipse" where "/home/venku/workspace" is a symbolic link
ot "/workspace".  So, canonicalPath.getDevice() should return the device on
which "/" is hosted.  Instead it returns null which I think is incorrect.
Comment 12 Darin Wright CLA 2005-06-20 09:18:30 EDT
The new problem is a different bug - a new bug report should be opened for the 
problem. Marking this bug as fixed.
Comment 13 Darin Wright CLA 2005-06-20 09:18:44 EDT
Verified.