Skip to content

remove rogue clara jar#1148

Draft
baltzell wants to merge 11 commits intodevelopmentfrom
rogue-clara-jar
Draft

remove rogue clara jar#1148
baltzell wants to merge 11 commits intodevelopmentfrom
rogue-clara-jar

Conversation

@baltzell
Copy link
Collaborator

@baltzell baltzell commented Mar 16, 2026

There's a jclara-4.3.jar in this repo, which gets installed via COATJAVA's build script into coatjava/lib/utils. That "rogue" jar serves (only) as a runtime dependency for the components of COATJAVA that extend CLARA, when run from outside CLARA, e.g. recon-util. Meanwhile, a normal CLARA installation also includes its own jclara jar, which CLARA runtime uses while explicitly ignoring coatjava/lib/utils. COATJAVA's maven build also ignores this rogue jar.

This pull request takes a small step in cleaning this up by:

  1. Removing the rogue jclara jar from coatjava's source repository.
  2. Instead using maven to retrieve and install a remote copy of that jar in coatjava/lib/utils
  3. Updating the maven build to use a new, non-SNAPSHOT jclara 4.3 maven repository

Also, as a prerequisite, a non-SNAPSHOT 4.3 maven repo was manually created on clasweb (by copying 4.3-SNAPSHOT).

  • Note, by construction, the resulting coatjava/lib/utils/jclara-4.3.jar is identical in filesize and jar tf output.
  • Note, this also facilitates moving away from this legacy jclara 4.3 dependency towards a maintained maven repo based on https://code.jlab.org/hallb/clas12/coatjava/clara-java.
  • Note, CLARA versions after 4.3 only change CLARA runtime.

@baltzell
Copy link
Collaborator Author

Weird, this google json library wasn't in the jclara jar:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gson/JsonParseException
	at ai.djl.repository.RepositoryFactoryImpl.init(RepositoryFactoryImpl.java:112)
	at ai.djl.repository.RepositoryFactoryImpl.<clinit>(RepositoryFactoryImpl.java:51)
	at ai.djl.repository.Repository.newInstance(Repository.java:90)
	at ai.djl.repository.zoo.DefaultModelZoo.parseLocation(DefaultModelZoo.java:66)
	at ai.djl.repository.zoo.DefaultModelZoo.<init>(DefaultModelZoo.java:47)
	at ai.djl.repository.zoo.Criteria$Builder.optModelPath(Criteria.java:591)
	at org.jlab.rec.ahdc.AI.ModelTrackFinding.<init>(ModelTrackFinding.java:47)
	at org.jlab.service.ahdc.AHDCEngine.init(AHDCEngine.java:84)
	at org.jlab.clas.reco.EngineProcessor.addEngine(EngineProcessor.java:235)
	at org.jlab.clas.reco.EngineProcessor.addEngine(EngineProcessor.java:254)
	at org.jlab.clas.reco.EngineProcessor.initAll(EngineProcessor.java:186)
	at org.jlab.clas.reco.EngineProcessor.main(EngineProcessor.java:426)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParseException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)

@c-dilks
Copy link
Member

c-dilks commented Mar 17, 2026

Weird, this google json library wasn't in the jclara jar:

Perhaps then we can get rid of the dependency conflict resolution here too:

coatjava/pom.xml

Lines 227 to 235 in 1ccf10a

<!-- resolve conflict between `org.jlab.coda:jclara` and `ai.djl:api`
by choosing the later version of their `com.google.code.gson:gson` dependency
- `djl`'s `gson` version is here: https://github.com/deepjavalibrary/djl/blob/master/gradle/libs.versions.toml
-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.13.1</version> <!-- WARNING: if changed, see `docs/dependency_conflicts.md` -->
</dependency>

@baltzell
Copy link
Collaborator Author

no luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants