Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java memory-calculator will fail if you have a directory with a ".jar" extension #160

Closed
3 tasks
dmikusa opened this issue Apr 4, 2022 · 0 comments · Fixed by #167
Closed
3 tasks

Java memory-calculator will fail if you have a directory with a ".jar" extension #160

dmikusa opened this issue Apr 4, 2022 · 0 comments · Fixed by #167
Labels
type:bug A general bug

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Apr 4, 2022

What happened?

  • What were you attempting to do?

Run an app image.

  • What was the actual behavior? Please provide log output, if possible.
C:\projects\monetka-app>docker run docker.io/library/monetka-app:0.0.1-SNAPSHOT
Setting Active Processor Count to 6
unable to determine class count
unable to walk /workspace
unable to open ZIP /workspace/META-INF/licenses/client-2.1.jar
read /workspace/META-INF/licenses/client-2.1.jar: is a directory
ERROR: failed to launch: exec.d: failed to execute exec.d file at path '/layers/paketo-buildpacks_bellsoft-liberica/helper/exec.d/memory-calculator': exit status 1

Classes does not seem to take into account the actual file type, it just looks at the extension. If you name a folder foo.jar it'll try to process it as a JAR file, which fails because you cannot unzip a directory.

I could see the following two checks being helpful:

  1. Check that the file is actually a file, not a directory.

2a. Check that the file is actually a zip file before trying to extract it.

or

2b. Check the error. If it's complaining that the file is not a zip, ignore the error and continue on.

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.
@dmikusa dmikusa added the type:bug A general bug label Apr 4, 2022
pivotal-david-osullivan added a commit that referenced this issue May 4, 2022
pivotal-david-osullivan added a commit that referenced this issue May 4, 2022
pivotal-david-osullivan added a commit that referenced this issue May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant