Informatievlaanderen / VSDS-LDESServer4J

Linked Data Event Streams Server for Java
https://informatievlaanderen.github.io/VSDS-LDESServer4J
European Union Public License 1.2
10 stars 11 forks source link

PaginationRowMapper.mapRow causes an exception due to compaction renaming pages using GUIDs #1365

Closed rorlic closed 2 months ago

rorlic commented 2 months ago

Currently pages use a numbering scheme and get named something like /verkeersmetingen/by-page?pageNumber=45955but when compaction kicks in new pages are created using GUIDs like /verkeersmetingen/by-page?pageNumber=3417f8c5-caf6-4b13-9bde-4f7ca46491ad. However, the PaginationRowMapper.mapRow expects a numeric value and therefore an exception is thrown: java.lang.NumberFormatException: For input string: "4795c80a-172d-4bcd-ab96-66eb90f8b5cd", e.g.:

org.springframework.retry.RetryException: Non-skippable exception in recoverer while processing
    at org.springframework.batch.core.step.item.FaultTolerantChunkProcessor.lambda$transform$1(FaultTolerantChunkProcessor.java:284) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
    ...
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: For input string: "4795c80a-172d-4bcd-ab96-66eb90f8b5cd"
    at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:371) ~[postgres-admin-repository-jar-with-dependencies.jar:na]
    ...
    at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
    ... 19 common frames omitted
Caused by: java.lang.NumberFormatException: For input string: "4795c80a-172d-4bcd-ab96-66eb90f8b5cd"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[na:na]
    at java.base/java.lang.Integer.parseInt(Integer.java:662) ~[na:na]
    at java.base/java.lang.Integer.parseInt(Integer.java:778) ~[na:na]
    at be.vlaanderen.informatievlaanderen.ldes.server.pagination.valueobjects.PageNumber.fromString(PageNumber.java:27) ~[ldes-server-compaction-jar-with-dependencies.jar:na]
    at be.vlaanderen.informatievlaanderen.ldes.server.pagination.valueobjects.PartialUrl.fromUrl(PartialUrl.java:45) ~[ldes-server-compaction-jar-with-dependencies.jar:na]
    at be.vlaanderen.informatievlaanderen.ldes.server.pagination.entities.Page.<init>(Page.java:31) ~[ldes-server-compaction-jar-with-dependencies.jar:na]
    at be.vlaanderen.informatievlaanderen.ldes.server.pagination.postgres.batch.PaginationRowMapper.mapRow(PaginationRowMapper.java:17) ~[postgres-pagination-repository-jar-with-dependencies.jar:na]
    at be.vlaanderen.informatievlaanderen.ldes.server.pagination.postgres.batch.PaginationRowMapper.mapRow(PaginationRowMapper.java:9) ~[postgres-pagination-repository-jar-with-dependencies.jar:na]
    ...
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[ldes-fragmentisers-common-jar-with-dependencies.jar:na]
    ... 33 common frames omitted
jobulcke commented 2 months ago

Resolved in #1373