[FOLIO-2734] mod-circulation fails tenant init in reference builds Created: 18/Aug/20  Updated: 24/Aug/20  Resolved: 24/Aug/20

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: TBD
Reporter: Ian Hardy Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File mod-circulation.log    
Issue links:
Relates
relates to CIRC-883 Upgrade to JDK 11 Closed
Sprint:
Development Team: FOLIO DevOps

 Description   

builds of folio-testing are failing when trying to enable mod-circulation. See attached mod circulation log.

Error itself may coming from RMB?: https://github.com/folio-org/raml-module-builder/blob/master/domain-models-interface-extensions/src/main/java/org/folio/rest/tools/PomReader.java#L37



 Comments   
Comment by Marc Johnson [ 18/Aug/20 ]

Julian Ladisch Adam Dickmeiss Kateryna Senchenko

Any ideas what might be causing this? Are / were there changes needed in pub-sub client or RAML Module Builder for this to make it compatible with JDK 11?

Comment by Julian Ladisch [ 18/Aug/20 ]

All dependencies must be Java 11 compatible.
The first RMB version that is Java 11 compatible is 31.0.0.
mod-circulation has older RMB dependencies that need to be upgraded:

mvn dependency:tree -Dincludes=org.folio

[INFO] org.folio:mod-circulation:jar:19.1.0-SNAPSHOT
[INFO] +- org.folio:mod-pubsub-client:jar:1.2.3:compile
[INFO] |  +- org.folio:domain-models-runtime:jar:30.0.2:compile
[INFO] |  |  \- org.folio:cql2pgjson:jar:30.0.2:compile
[INFO] |  |     \- org.folio:dbschema:jar:30.0.2:compile
[INFO] |  +- org.folio:domain-models-api-interfaces:jar:30.0.2:compile
[INFO] |  |  +- org.folio:domain-models-api-aspects:jar:30.0.2:compile
[INFO] |  |  \- org.folio:domain-models-interface-extensions:jar:30.0.2:compile
[INFO] |  \- org.folio:folio-di-support:jar:1.0.0:compile
[INFO] +- org.folio:util:jar:30.2.2:compile
[INFO] \- org.folio:testing:jar:30.2.2:test
Comment by Marc Johnson [ 18/Aug/20 ]

Julian Ladisch

Thanks. I hadn't realised (or had forgotten) that mod-circulation circuitously includes RAML Module Builder :-/

Why wouldn't the Jenkins build running on JDK 11 have picked this up?

Comment by Julian Ladisch [ 18/Aug/20 ]

Is there an integration test that runs Launcher.main? https://github.com/folio-org/mod-circulation/blob/76651ffa520f196957befc5b9c88bbeab917ef7c/pom.xml#L289

Comment by Marc Johnson [ 18/Aug/20 ]

Julian Ladisch

Is there an integration test that runs Launcher.main?

No, however all of the API / integration tests use launcher.start which I would imagine for these purposes is equivalent, given that the error occurs during the Tenant API which is invoked during those tests.

Comment by Bohdan Suprun (Inactive) [ 18/Aug/20 ]

Marc Johnson,

The utility method that causes the issue executes different parts of logic depending whether it is executed within jar file or tests - PomReader.java.

I think we should revert circ now until the pub-sub client is migrated to the latest RMB. Alternatively, just use own client.

Comment by Marc Johnson [ 18/Aug/20 ]

Bohdan Suprun

Thanks for investigating this.

The utility method that causes the issue executes different parts of logic depending whether it is executed within jar file or tests

That's unfortunate. Meaning that tests would not have caught this :-/

I think we should revert circ now until the pub-sub client is migrated to the latest RMB. Alternatively, just use own client.

I'll revert the JDK 11 upgrade of mod-circulation :-/

Kateryna Senchenko Is there an issue for making the pub-sub client compatible with JDK 11, that the mod-circulation upgrade can be blocked on?

Comment by Julian Ladisch [ 18/Aug/20 ]

mod-circulation has unit tests only: *Test.java executed by maven-surefire-plugin.
It doesn't have integration test: *IT.java executed by maven-failsafe-plugin.

Comment by Marc Johnson [ 18/Aug/20 ]

Julian Ladisch

I don't really understand the difference between surefire and failsafe. Do they define a special meaning for unit and integration tests? And tests executed by the failsafe plugin execute the packaged jar?

Comment by Julian Ladisch [ 19/Aug/20 ]

Yes.
Example for raml-module-builder/util submodule, output taken from mvn --debug clean verify:

surefire:
boot(compact) classpath: ... test-classes classes ...

failsafe:
boot(compact) classpath: ... test-classes util-31.1.0-SNAPSHOT.jar ...

maven has these phases (taken from https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html#maven-phases ):

  • validate: validate the project is correct and all necessary information is available
  • compile: compile the source code of the project
  • test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  • package: take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test: process and deploy the package if necessary into an environment where integration tests can be run
  • verify: run any checks to verify the package is valid and meets quality criteria
  • install: install the package into the local repository, for use as a dependency in other projects locally
  • deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

surefire is the test phase and tests the .class files, failsafe is the integration-test and verify phase and tests the .jar file.

Comment by Marc Johnson [ 19/Aug/20 ]

Thanks Julian Ladisch I'm still rather inexperienced with Maven.

I may investigate moving the API style tests over to use the failSafe plugin and the integration-test phase.

Comment by Marc Johnson [ 24/Aug/20 ]

Resolved by reverting the upgrade to Java 11

Generated at Thu Feb 08 23:22:51 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.