Skip to content

Add custer mode test in the CI#3943

Merged
sebr72 merged 5 commits intomasterfrom
test-cluster-mode-GSMFP-33
Feb 10, 2026
Merged

Add custer mode test in the CI#3943
sebr72 merged 5 commits intomasterfrom
test-cluster-mode-GSMFP-33

Conversation

@sbrunner
Copy link
Copy Markdown
Member

@sbrunner sbrunner commented Jan 22, 2026

See JIRA issue: GSMFP-33.

@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch 4 times, most recently from fc9ef22 to 86f3073 Compare January 22, 2026 15:49
@sbrunner
Copy link
Copy Markdown
Member Author

Issue:

  java.lang.IllegalArgumentException: Unable to locate persister: org.mapfish.print.servlet.job.HibernateAccountingEntry
  	at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:861)
  	at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:840)
  	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.lambda$insertRecord$0(HibernateAccounting.java:76)
  	at org.springframework.transaction.support.TransactionOperations.lambda$executeWithoutResult$0(TransactionOperations.java:68)
  	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
  	at org.springframework.transaction.support.TransactionOperations.executeWithoutResult(TransactionOperations.java:67)
  	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.insertRecord(HibernateAccounting.java:73)
  	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.onJobSuccess(HibernateAccounting.java:48)
  	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:174)
  	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:52)
  	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  	at java.base/java.lang.Thread.run(Unknown Source)
  Caused by: org.hibernate.UnknownEntityTypeException: Unable to locate persister: org.mapfish.print.servlet.job.HibernateAccountingEntry
  	at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.getEntityDescriptor(MappingMetamodelImpl.java:395)
  	at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1501)
  	at org.hibernate.event.internal.DefaultMergeEventListener.merge(DefaultMergeEventListener.java:166)
  	at org.hibernate.event.internal.DefaultMergeEventListener.doMerge(DefaultMergeEventListener.java:152)
  	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:136)
  	at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:89)
  	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
  	at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:854)
  	... 13 common frames omitted

@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch from 4ab7ddd to 27f5741 Compare January 23, 2026 10:13
@sbrunner
Copy link
Copy Markdown
Member Author

Now I get:

2026-01-23T10:32:42.3961196Z org.hibernate.exception.SQLGrammarException: could not execute statement [ERROR: column "stats" is of type jsonb but expression is of type bytea
2026-01-23T10:32:42.3961634Z   Hint: You will need to rewrite or cast the expression.
2026-01-23T10:32:42.3962584Z   Position: 204] [insert into public.print_accountings (app_id,completion_time,file_size,layout,mapExport,output_format,processing_time_ms,referrer,stats,status,total_time_ms,reference_id) values (?,?,?,?,?,?,?,?,?,?,?,?)]
2026-01-23T10:32:42.3963151Z 	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:91)
2026-01-23T10:32:42.3963751Z 	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:58)
2026-01-23T10:32:42.3964233Z 	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:108)
2026-01-23T10:32:42.3964772Z 	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
2026-01-23T10:32:42.3965475Z 	at org.hibernate.engine.jdbc.mutation.internal.AbstractMutationExecutor.performNonBatchedMutation(AbstractMutationExecutor.java:134)
2026-01-23T10:32:42.3966409Z 	at org.hibernate.engine.jdbc.mutation.internal.MutationExecutorSingleNonBatched.performNonBatchedOperations(MutationExecutorSingleNonBatched.java:55)
2026-01-23T10:32:42.3967009Z 	at org.hibernate.engine.jdbc.mutation.internal.AbstractMutationExecutor.execute(AbstractMutationExecutor.java:55)
2026-01-23T10:32:42.3967643Z 	at org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.doStaticInserts(InsertCoordinatorStandard.java:194)
2026-01-23T10:32:42.3968280Z 	at org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.coordinateInsert(InsertCoordinatorStandard.java:132)
2026-01-23T10:32:42.3968861Z 	at org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.insert(InsertCoordinatorStandard.java:104)
2026-01-23T10:32:42.3969337Z 	at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:110)
2026-01-23T10:32:42.3969774Z 	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:644)
2026-01-23T10:32:42.3970208Z 	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:511)
2026-01-23T10:32:42.3970847Z 	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:414)
2026-01-23T10:32:42.3971397Z 	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:41)
2026-01-23T10:32:42.3972030Z 	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
2026-01-23T10:32:42.3972432Z 	at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1429)
2026-01-23T10:32:42.3972900Z 	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1415)
2026-01-23T10:32:42.3973495Z 	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.lambda$insertRecord$0(HibernateAccounting.java:77)
2026-01-23T10:32:42.3974145Z 	at org.springframework.transaction.support.TransactionOperations.lambda$executeWithoutResult$0(TransactionOperations.java:68)
2026-01-23T10:32:42.3974717Z 	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
2026-01-23T10:32:42.3975411Z 	at org.springframework.transaction.support.TransactionOperations.executeWithoutResult(TransactionOperations.java:67)
2026-01-23T10:32:42.3976063Z 	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.insertRecord(HibernateAccounting.java:73)
2026-01-23T10:32:42.3976638Z 	at org.mapfish.print.servlet.job.HibernateAccounting$JobTracker.onJobSuccess(HibernateAccounting.java:48)
2026-01-23T10:32:42.3977026Z 	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:174)
2026-01-23T10:32:42.3977395Z 	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:52)
2026-01-23T10:32:42.3977764Z 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
2026-01-23T10:32:42.3978197Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
2026-01-23T10:32:42.3978746Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
2026-01-23T10:32:42.3979058Z 	at java.base/java.lang.Thread.run(Unknown Source)
2026-01-23T10:32:42.3979621Z Caused by: org.postgresql.util.PSQLException: ERROR: column "stats" is of type jsonb but expression is of type bytea
2026-01-23T10:32:42.3979944Z   Hint: You will need to rewrite or cast the expression.
2026-01-23T10:32:42.3980192Z   Position: 204
2026-01-23T10:32:42.3980709Z 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2846)
2026-01-23T10:32:42.3981192Z 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2531)
2026-01-23T10:32:42.3981624Z 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:429)
2026-01-23T10:32:42.3982041Z 	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:526)
2026-01-23T10:32:42.3982420Z 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:436)
2026-01-23T10:32:42.3982923Z 	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:196)
2026-01-23T10:32:42.3983409Z 	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:157)
2026-01-23T10:32:42.3983964Z 	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:1159)
2026-01-23T10:32:42.3984506Z 	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:194)
2026-01-23T10:32:42.3984770Z 	... 26 common frames omitted

@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch 4 times, most recently from 5ac1891 to b95ec8f Compare January 26, 2026 09:22
@sbrunner
Copy link
Copy Markdown
Member Author

Current issue:

2026-01-23T14:44:35.5578728Z org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: Template 'secured' requires an authenticated user
2026-01-23T14:44:35.5580086Z 	at org.mapfish.print.config.access.RoleAccessAssertion.assertAccess(RoleAccessAssertion.java:60)
2026-01-23T14:44:35.5581143Z 	at org.mapfish.print.config.Template.assertAccessible(Template.java:370)
2026-01-23T14:44:35.5582090Z 	at org.mapfish.print.config.Configuration.getTemplate(Configuration.java:316)
2026-01-23T14:44:35.5583132Z 	at org.mapfish.print.MapPrinter.getOutputFormat(MapPrinter.java:105)
2026-01-23T14:44:35.5584000Z 	at org.mapfish.print.MapPrinter.print(MapPrinter.java:129)
2026-01-23T14:44:35.5584884Z 	at org.mapfish.print.servlet.job.PrintJob.lambda$call$0(PrintJob.java:148)
2026-01-23T14:44:35.5585880Z 	at org.mapfish.print.servlet.job.PrintJob.withOpenOutputStream(PrintJob.java:110)
2026-01-23T14:44:35.5586851Z 	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:146)
2026-01-23T14:44:35.5587716Z 	at org.mapfish.print.servlet.job.PrintJob.call(PrintJob.java:52)
2026-01-23T14:44:35.5588569Z 	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
2026-01-23T14:44:35.5589466Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
2026-01-23T14:44:35.5590418Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
2026-01-23T14:44:35.5591257Z 	at java.base/java.lang.Thread.run(Unknown Source)

It seems that the authentication configuration is not working with cluster mode!

@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch 2 times, most recently from 6c82a26 to 86a4f60 Compare February 10, 2026 14:44
@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch from 86a4f60 to 0f296c5 Compare February 10, 2026 14:47
@sbrunner sbrunner marked this pull request as ready for review February 10, 2026 14:48
Copilot AI review requested due to automatic review settings February 10, 2026 14:48
@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch from 0f296c5 to 5bc2127 Compare February 10, 2026 14:48
@sbrunner sbrunner requested a review from sebr72 February 10, 2026 14:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the acceptance-test setup to support running the examples integration tests in “cluster mode” (DB-backed job queue) in CI, and documents how to run those CI acceptance tests locally.

Changes:

  • Add a second CI acceptance-test run using a new docker-compose-cluster.yaml and an env-gated cluster-only test.
  • Add acceptance-test DB/cluster Spring override config and ensure the tester image includes it.
  • Allow passing custom docker-compose flags via DOCKER_COMPOSE_ARGS in make acceptance-tests-* targets, and document the workflow.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/src/test/java/org/mapfish/print/PrintApiTest.java Gates one secured-template test to run only when the cluster-mode env var is set.
examples/README.md Documents CI acceptance-test commands and how to run with the cluster compose file.
docker-compose-cluster.yaml Adds a DB service and a compose definition intended for cluster-mode acceptance tests.
core/src/main/resources/mapfish-spring-application-context-override-db.xml Sets a default DB port (5432) in the JDBC URL placeholder.
core/src/main/java/org/mapfish/print/config/access/RoleAccessAssertion.java Splits null checks to throw a clearer exception when the security context is unavailable.
core/extraConfigFor/acceptanceTests/mapfish-spring-application-context-override-db.xml Introduces acceptance-test cluster-mode override config (DB job queue + clustered job manager + auth).
core/Dockerfile Copies the new acceptance-test DB override into the tester image and adjusts permissions.
Makefile Adds DOCKER_COMPOSE_ARGS support to acceptance-test up/run/down targets.
.github/workflows/main.yaml Runs acceptance tests twice (normal + cluster) in CI, setting the required env vars for the cluster run.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sbrunner sbrunner force-pushed the test-cluster-mode-GSMFP-33 branch from d5a073a to 4ab4fc3 Compare February 10, 2026 15:49
Copy link
Copy Markdown
Contributor

@sebr72 sebr72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thanks

@sebr72 sebr72 merged commit 6cde594 into master Feb 10, 2026
15 checks passed
@sebr72 sebr72 deleted the test-cluster-mode-GSMFP-33 branch February 10, 2026 17:11
@geo-ghci-int geo-ghci-int bot added this to the 4.0.0 milestone Feb 13, 2026
@sbrunner sbrunner added the tests Tests label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants