monarch-initiative / phenol

phenol: Phenotype ontology library
https://phenol.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 4 forks source link

Let's remove guava from phenol #428

Closed pnrobinson closed 10 months ago

pnrobinson commented 1 year ago

After the recent HPO release in April 23,

Ontology ontology = OntologyLoader.loadOntology(new File(hpJsonPath));

seems to lead to this

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Multimap
    at com.fasterxml.jackson.datatype.guava.GuavaTypeModifier.modifyType(GuavaTypeModifier.java:42)
    (...)
    at org.monarchinitiative.phenol.io.obographs.OboGraphDocumentLoader.loadJson(OboGraphDocumentLoader.java:35)
    at org.monarchinitiative.phenol.io.OntologyLoader.loadGraphDocument(OntologyLoader.java:107)
    at org.monarchinitiative.phenol.io.OntologyLoader.loadGraphDocument(OntologyLoader.java:90)
    at org.monarchinitiative.phenol.io.OntologyLoader.loadOntology(OntologyLoader.java:43)
    at org.monarchinitiative.phenol.io.OntologyLoader.loadOntology(OntologyLoader.java:35)
    at org.monarchinitiative.hpoannotqc.cmd.BigFileCommand.call(BigFileCommand.java:63)

This is in the HpoAnnotQc app but the problem appears to be coming from phenol 2.0.0. @iimpulse @ielis

Could this be coming from this in the module info for the io module?

requires com.fasterxml.jackson.datatype.guava;
ielis commented 1 year ago

No, guava is a transitive dependency of obographs-core:

cd phenol
./mvnw install
./mvnw depenency:tree
(...)
org.monarchinitiative.phenol:phenol-io:jar:2.0.1-SNAPSHOT
 +- org.monarchinitiative.phenol:phenol-core:jar:2.0.1-SNAPSHOT:compile
 |  \- org.jgrapht:jgrapht-core:jar:1.5.1:compile
 |     \- org.jheaps:jheaps:jar:0.13:compile
 +- org.geneontology.obographs:obographs-core:jar:0.3.0:compile
 |  +- com.google.guava:guava:jar:30.1-jre:compile
 |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
 |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
 |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
 |  |  +- org.checkerframework:checker-qual:jar:3.5.0:compile
 |  |  +- com.google.errorprone:error_prone_annotations:jar:2.3.4:compile
 |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
(...)

and I'm not sure obographs-core would work without it.

It looks suspicious though. Phenol uses guava 30.1-jre while hpoannotqc uses 30.0-jre - versions are too close and it sounds unlikely to me that they would have moved Multimap, leading to incompatibility. On a quick look I see no issues with phenol nor with hpoannotqc's pom.

I tried to build the latest develop of hpoannotqc here and it built OK. Then I ran the CLI (--help and download) and it seemed to work OK...