NoClassDefFoundError: XmlPullParserException on POST /_/tenant

Description

How to repoduce

Latest master https://github.com/folio-org/mod-feesfines/commit/2b5a3f3dc11df29cc2bfac134204533c0db7762c

mvn clean install

java -jar target/mod-feesfines-fat.jar

curl -w"\n" -H "x-okapi-tenant: diku" -H "Content-type: application/json" -H "x-okapi-url-to: http://localhost:8081" -d '{"module_to":"mod-feesfines-16.1.0"}' http://localhost:8081/_/tenant

A test should be added to https://github.com/folio-org/mod-feesfines/blob/master/src/test/java/org/folio/rest/impl/TenantRefAPITest.java that checks that POST /_/tenant succeeds.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Alexander Kurash June 10, 2021 at 5:07 PM
Edited

Thanks Julian. This approach should work well at run-time when it looks for the manifest file in the META-INF dir, but at build-time (unit tests or just running locally in the IDE) it wasn't working for us, so we just used a slightly modified version of PomReader.

Julian Ladisch June 9, 2021 at 9:28 PM

You can use getClass().getPackage().getImplementationVersion():

https://stackoverflow.com/a/2713013

Alexander Kurash June 9, 2021 at 9:21 PM

 RMB used to have PomReader class that is now gone (became part of a plugin that is not recommended to be added as a dependency, as I understand). As a replacement RMB v33 provides ModuleName class, but it just has module's name. PomReader was widely used to get module's version as well. Is there something in RMB 33 that would provide the same functionality?

John Malconian June 9, 2021 at 4:48 PM

Looks like build 16.1.0-SNAPSHOT.150 did not resolve the issue. Here is the log snippet:

Alexander Kurash June 9, 2021 at 3:51 PM

A test should be added to https://github.com/folio-org/mod-feesfines/blob/master/src/test/java/org/folio/rest/impl/TenantRefAPITest.java that checks that POST /_/tenant succeeds.

There is a test for this, it's in the parent class ApiTests - we're making sure BeforeClass that POST _tenant returns No Content. Though, this test didn't catch the error because missing dependency actually is present when tests are running - it had a test scope in the POM.

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Vega

Fix versions

Release

R2 2021

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created June 9, 2021 at 2:38 PM
Updated June 14, 2021 at 1:21 PM
Resolved June 14, 2021 at 10:55 AM
TestRail: Cases
TestRail: Runs