question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scan with Scala library in classpath gives error about different superclasses

See original GitHub issue

See the attached fast-classpath-scanner-scala.tar.gz file containing a Gradle project which runs a test attempting to scan with the Scala library version 2.12.4 in the classpath.

The archive includes a verbose.log file from my local run (on a Mac). The exception message is:

Caused by: java.lang.IllegalArgumentException: A class and its auxiliary class have different superclasses: class extends scala.collection.generic.SeqFactory<scala.collection.immutable.Stack> implements scala.Serializable ; <A> class extends scala.collection.AbstractSeq<A> implements scala.collection.immutable.LinearSeq<A>, scala.collection.LinearSeqOptimized<A, scala.collection.immutable.Stack<A>>, scala.Serializable

You should be able to run yourself using:

tar xvfz fast-classpath-scanner-scala.tar.gz
cd fast-classpath-scanner-scala
./gradlew build

The test sends System.out/System.err to the verbose.log file.

For now, I’ll try to work around the issue by determining how to exclude certain packages or files from scanning.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lukehutchcommented, May 3, 2018

@ryan-gustafson @pshirshov this is fixed in 2.19.0.

You will now get pkg.Class for a base class in Scala, pkg.Class$ for a companion object, and pkg.Class$class for a trait methods class (i.e. these are no longer merged into pkg.Class).

0reactions
lukehutchcommented, May 7, 2018

@ryan-gustafson I just pushed out version 2.20.1, with support for explicitly blacklisting classpath elements based on a string match criterion:

https://github.com/lukehutch/fast-classpath-scanner/releases/tag/fast-classpath-scanner-2.20.1

This will work better than the code snippet I gave in #190, since it applies the filtering before extracting jars-within-jars (in the case that you have classpath elements like path/to/jar1.jar!/BOOT-INF/lib/jar2.jar).

(However, hopefully you don’t need to skip directories now that Scala scanning is fixed.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does Java classpath different order give "No Method found ...
It certainly can, if the same class file is present in different classpath entries. For example, if your classpath is: java -cp a.jar:b.jar ......
Read more >
No 'scala-library*.jar' in Scala compiler classpath in ... - GitHub
In a mill project: mill mill.scalalib.GenIdeaModule/idea Then open idea and set scala project, and build. It reports: Error:scalac: No 'scala-library*.jar' ...
Read more >
Authoring Tasks - Gradle User Manual
The following shows how to access a task by path. This is not a recommended practice anymore as it breaks task configuration avoidance...
Read more >
Apache HBase ™ Reference Guide
Use the scan command to scan the table for data. ... In the next sections we give a quick overview of other modes...
Read more >
With IntelliJ 2017.02.5, receiving error "Error:scalac: No 'scala ...
Creating a brand new Scala SBT project using IntelliJ 2017.2.5 (Scala Plugin 2017.2.11) is producing the following error when I attempt...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found