You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2022/06/09 10:31:57 UTC

[Bug 66110] New: javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

            Bug ID: 66110
           Summary: javac fails with "ZIP file can't be opened as a file
                    system because an entry has a '.' or '..' element in
                    its name"
           Product: Ant
           Version: 1.10.5
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: hauser@acm.org
  Target Milestone: ---

after upgrading openjdk11 to its latest build, my project no nonger compiles

seems to be related to commit:
https://github.com/openjdk/jdk/commit/3e3051e2ee93142983e9a3edee038e4f7b5ac0f2


the more we look into it, it appears that it fails on classes that are not in a
ZIP i.e. jar file in the first place


https://bugs.openjdk.org/browse/JDK-8283486

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

Michele Occhipinti <oc...@privasphere.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Michele Occhipinti <oc...@privasphere.com> ---
The bug persists with ant version 1.10.12

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Jaikiran Pai <ja...@apache.org> ---
Hello Ralf, this need not necessarily be an Ant issue. The error message
doesn't currently tell which jar in the classpath is having such an entry. A
fix has been recently made in Java upstream (19 version which hasn't yet been
released) where that jar name will be printed in cases like these. Until then,
you might have to experiment with the classpath to figure out which jar is
causing this issue. What would be interesting is whether such a jar was
generated by Ant in first place. If not, then I think this is more to do with
the jar itself than Ant.

If you aren't able to narrow down the jar which causes this problem, perhaps
you could provide us a (simplified) reproducer/build instructions which might
help us reproduce this issue?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

--- Comment #4 from Ralf Hauser <ha...@acm.org> ---
particularly bad is also the very misleading output


    [javac] /tmp/bz66110/src/com/abc/Bz66110.java:1: error: cannot access
com.abc
    [javac] package com.abc;

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Jaikiran Pai <ja...@apache.org> ---
I have asked this question in the OpenJDK mailing list
https://mail.openjdk.org/pipermail/compiler-dev/2022-June/019999.html. 

Given that Ant isn't the one generating this jar file and that the compilation
failure is originating from the javac tool itself, I'll close this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

Ralf Hauser <ha...@acm.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hauser@acm.org

--- Comment #3 from Ralf Hauser <ha...@acm.org> ---
Created attachment 38320
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38320&action=edit
bz66110a.jar

once you unpack the jar, just do 

   cd ~/bz66110; ant -v -d build 2>&1 | tee ant`date +%y%m%d_%H%M%S`.txt

to reproduce it.

No clue how the empty 
  ./
directory got into the bz66110badJar.jar

==> if ant could warn, this would be great

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66110] javac fails with "ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66110

--- Comment #5 from Jaikiran Pai <ja...@apache.org> ---
Hello Ralf, thank you for that additional detail. Looking at the attached jar,
I see that it's MANIFEST.MF has this:

> Created-By: 0.92-gcc

So it looks like that jar was generated by gcc's fastjar tool. 0.92 appears to
be the version of that tool (not sure)? If you have control over that specific
jar's generation, then you might want to fix that jar or use a different
version or a different tool to generate it.

Ultimately, this is something that needs to be handled at the JDK level and not
Ant. My personal opinion is that an invalid jar in the classpath shouldn't
cause the compiler to throw an exception. The JDK team will know more on how it
should behave. So I'll ask for inputs from the JDK team.

-- 
You are receiving this mail because:
You are the assignee for the bug.