{"record":{"id":"3fd06d3883f6e877","repo":"quarkusio/quarkus","slug":"no-entities-with-xml-were-found","errorCode":null,"errorMessage":"No entities with XML were found","messagePattern":"No entities with XML were found","errorType":"http","errorClass":"AssertionError","httpStatus":500,"severity":"error","filePath":"integration-tests/jpa-postgresql-withxml/src/main/java/io/quarkus/it/jpa/postgresql/JPAFunctionalityTestEndpoint.java","lineNumber":209,"sourceCode":"            //ignore this one\n        }\n    }\n\n    @GET\n    @Path(\"hibernate-xml\")\n    public String hibernateXml() {\n        QuarkusTransaction.requiringNew().run(() -> {\n            EntityWithXml entity = new EntityWithXml(\n                    new EntityWithXml.ToBeSerializedWithDateTime(LocalDate.of(2023, 7, 28)));\n            em.persist(entity);\n        });\n\n        QuarkusTransaction.requiringNew().run(() -> {\n            List<EntityWithXml> entities = em\n                    .createQuery(\"select e from EntityWithXml e\", EntityWithXml.class)\n                    .getResultList();\n            if (entities.isEmpty()) {\n                throw new AssertionError(\"No entities with XML were found\");\n            }\n        });\n\n        QuarkusTransaction.requiringNew().run(() -> {\n            em.createQuery(\"delete from EntityWithXml\").executeUpdate();\n        });\n\n        Exception exception = null;\n        try {\n            QuarkusTransaction.requiringNew().run(() -> {\n                EntityWithXmlOtherPU otherPU = new EntityWithXmlOtherPU(\n                        new EntityWithXmlOtherPU.ToBeSerializedWithDateTime(LocalDate.of(2023, 7, 28)));\n                otherEm.persist(otherPU);\n            });\n        } catch (Exception e) {\n            exception = e;\n        }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/jpa-postgresql-withxml/src/main/java/io/quarkus/it/jpa/postgresql/JPAFunctionalityTestEndpoint.java#L191-L227","documentation":"An AssertionError from hibernateXml when an HQL query 'select e from EntityWithXml e' returns no rows. The test expects at least one entity with an XML-mapped attribute to exist (written earlier in the test), so an empty result means the write step failed silently or was rolled back.","triggerScenarios":"createQuery(\"select e from EntityWithXml e\").getResultList() is empty inside a new transaction - earlier persist(s) of EntityWithXml did not commit, or the table was already cleaned.","commonSituations":"Custom XML FormatMapper throwing during flush (causing rollback of the seed data), test ordering issues, or leftover cleanup ('delete from EntityWithXml') from a previous run.","solutions":["Verify the earlier persist/flush of EntityWithXml succeeded (check for swallowed exceptions)","Run the test against a clean database to rule out prior cleanup deleting rows","Check whether the custom XML mapper caused a rollback before the select executes"],"exampleFix":"// before\nList<EntityWithXml> entities = em.createQuery(\"select e from EntityWithXml e\", EntityWithXml.class).getResultList();\nif (entities.isEmpty()) { throw new AssertionError(\"No entities with XML were found\"); }\n// after\nlong count = (Long) em.createQuery(\"select count(e) from EntityWithXml e\").getSingleResult();\nassertTrue(count > 0, \"EntityWithXml rows missing; seed step result=\" + count);","handlingStrategy":"validation","validationCode":"long count = em.createQuery(\"select count(e) from EntityWithXml e\", Long.class).getSingleResult();\nif (count == 0) { throw new AssertionError(\"Seed data missing before hibernateXml assertions\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert the seed/persist step succeeded before querying","Clean the table in setup, not just teardown","Watch for rollbacks caused by throwing format mappers earlier in the test"],"tags":["jpa","hibernate","xml","test-assertion"],"backgroundTag":"expected-row-missing","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}