Reading a Jar (Project) fails instantly

Issue #154 closed
Ben Hermann created an issue

I tried this in the published 1.1.0-SNAPSHOT:

  val p = Project(dummyFile, org.opalj.bytecode.RTJar)

  val projectMethods = p.allProjectClassFiles.flatMap(cf => cf.methods)

And received a very log stack trace looking like this:

[error][class file reader] class java.lang.NoSuchMethodError: org.opalj.collection.immutable.IntTrieSet.foreach(Lscala/Function1;)V
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.optimizeInstructions(BytecodeOptimizer.scala:402)
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.optimizeInstructions$(BytecodeOptimizer.scala:141)
[error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.optimizeInstructions(Java8FrameworkWithCaching.scala:42)
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.$anonfun$Method_Info$1(BytecodeOptimizer.scala:130)
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.$anonfun$Method_Info$1$adapted(BytecodeOptimizer.scala:129)
[error][class file reader]  scala.Option.foreach(Option.scala:257)
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.Method_Info(BytecodeOptimizer.scala:129)
[error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.Method_Info$(BytecodeOptimizer.scala:122)
[error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Method_Info(Java8FrameworkWithCaching.scala:42)
[error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Method_Info(Java8FrameworkWithCaching.scala:42)
[error][class file reader]  org.opalj.bi.reader.MethodsReader.Method_Info(MethodsReader.scala:86)
[error][class file reader]  org.opalj.bi.reader.MethodsReader.Methods(MethodsReader.scala:76)
[error][class file reader]  org.opalj.bi.reader.MethodsReader.Methods$(MethodsReader.scala:73)
[error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Methods(Java8FrameworkWithCaching.scala:42)
[error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Methods(Java8FrameworkWithCaching.scala:42)
[error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile(ClassFileReader.scala:266)
[error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile$(ClassFileReader.scala:238)
...

Comments (11)

  1. Michael Eichberg repo owner

    I can't reproduce the behavior; however, I just updated the snapshot.

    Please, go to your .ivy folder and delete in local and cache everything related to OPAL. Sometimes weird things happen.

  2. Ben Hermann reporter

    I cleared my ivy cache and sbt downloaded the dependencies new. I still get the same error:

    [error][class file reader] class java.lang.NoSuchMethodError: org.opalj.collection.immutable.IntTrieSet.foreach(Lscala/Function1;)V
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.optimizeInstructions(BytecodeOptimizer.scala:402)
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.optimizeInstructions$(BytecodeOptimizer.scala:141)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.optimizeInstructions(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.$anonfun$Method_Info$1(BytecodeOptimizer.scala:130)
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.$anonfun$Method_Info$1$adapted(BytecodeOptimizer.scala:129)
    [error][class file reader]  scala.Option.foreach(Option.scala:257)
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.Method_Info(BytecodeOptimizer.scala:129)
    [error][class file reader]  org.opalj.br.reader.BytecodeOptimizer.Method_Info$(BytecodeOptimizer.scala:122)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Method_Info(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Method_Info(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.bi.reader.MethodsReader.Method_Info(MethodsReader.scala:86)
    [error][class file reader]  org.opalj.bi.reader.MethodsReader.Methods(MethodsReader.scala:76)
    [error][class file reader]  org.opalj.bi.reader.MethodsReader.Methods$(MethodsReader.scala:73)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Methods(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.Methods(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile(ClassFileReader.scala:266)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile$(ClassFileReader.scala:238)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.ClassFile(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.$anonfun$ClassFile$3(ClassFileReader.scala:339)
    [error][class file reader]  org.opalj.io.package$.process(package.scala:170)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile(ClassFileReader.scala:338)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.ClassFile$(ClassFileReader.scala:337)
    [error][class file reader]  org.opalj.br.reader.Java8FrameworkWithCaching.ClassFile(Java8FrameworkWithCaching.scala:42)
    [error][class file reader]  org.opalj.bi.reader.ClassFileReader.$anonfun$ClassFiles$2(ClassFileReader.scala:463)
    [error][class file reader]  scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
    [error][class file reader]  scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)
    [error][class file reader]  scala.util.Success.$anonfun$map$1(Try.scala:251)
    [error][class file reader]  scala.util.Success.map(Try.scala:209)
    [error][class file reader]  scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
    [error][class file reader]  scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
    [error][class file reader]  scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
    [error][class file reader]  scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
    [error][class file reader]  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [error][class file reader]  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [error][class file reader]  java.lang.Thread.run(Thread.java:745)
    [error][class file reader] processing org/codehaus/yom/XPathException.class failed
    [error][class file reader] 
    
  3. Michael Eichberg repo owner

    I just tested it again with the attached jar and can't reproduce the bug with the latest development version ; however, I will investigate the issue with the incorrect version informations tomorrow when I'm back in the office.

  4. Michael Eichberg repo owner

    I‘ve just updated the snapshot again - now the versions match; please, try again. I‘m sorry for the trouble!

  5. Ben Hermann reporter

    This now works for me... However, huge refactorings since 1.0.0. Have to to adjust my client code at lot. ;)

  6. Michael Eichberg repo owner

    Hi, if you have any questions related to the "refactorings", please let me know. I'm not aware that we made significant changes...

  7. Log in to comment