Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8326979

(jdeps) improve the error message for FindException caused by InvalidModuleDescriptorException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 23
    • tools
    • None
    • b15

      JDK-8325262 improves the error message to print the exception message of FindException without the stack trace. This can further be improved to show the cause message that will help the users to diagnose the invalid JAR input file.

      $ jdeps --ignore-missing-deps --jdk-internals test.jar
      Exception in thread "main" java.lang.module.FindException: Error reading module: test.jar
          at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:350)
          at java.base/jdk.internal.module.ModulePath.scan(ModulePath.java:237)
          at java.base/jdk.internal.module.ModulePath.scanNextEntry(ModulePath.java:190)
          at java.base/jdk.internal.module.ModulePath.findAll(ModulePath.java:166)
          at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:521)
          at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
          at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
          at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
          at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
      Caused by: java.lang.module.InvalidModuleDescriptorException: DeprecatedAuthExtensionsPlaceholder.class found in top-level directory (unnamed package not allowed in module)
          at java.base/jdk.internal.module.ModulePath.toPackageName(ModulePath.java:720)
          at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
          at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
          at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
          at java.base/java.util.zip.ZipFile$EntrySpliterator.tryAdvance(ZipFile.java:558)
          at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:332)
          at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
          at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
          at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
          at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
          at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
          at java.base/jdk.internal.module.ModulePath.jarPackages(ModulePath.java:621)
          at java.base/jdk.internal.module.ModulePath.lambda$readJar$6(ModulePath.java:653)
          at java.base/jdk.internal.module.ModuleInfo.doRead(ModuleInfo.java:311)
          at java.base/jdk.internal.module.ModuleInfo.read(ModuleInfo.java:129)
          at java.base/jdk.internal.module.ModulePath.readJar(ModulePath.java:652)
          at java.base/jdk.internal.module.ModulePath.readModule(ModulePath.java:331)
          ... 8 more

            mchung Mandy Chung
            mchung Mandy Chung
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: