Liquibase CustomTaskChange

Hello, we needed to implement a CustomTaskChange. This works at application startup, but the “Generate Liquibase Changelog” action from Jmix fails with a ClassNotFoundException:

Unexpected error running Liquibase: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.company.example.liquibase.AssignCampaignsToConsumers
For more information, please use the --logLevel flag
[2023-01-26 15:15:55] SEVERE [liquibase.integration] Unexpected error running Liquibase: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.company.example.liquibase.AssignCampaignsToConsumers
liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.company.example.liquibase.AssignCampaignsToConsumers
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
	at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:369)
	at liquibase.Liquibase.lambda$update$1(Liquibase.java:224)
	at liquibase.Scope.lambda$child$0(Scope.java:180)
	at liquibase.Scope.child(Scope.java:189)
	at liquibase.Scope.child(Scope.java:179)
	at liquibase.Scope.child(Scope.java:158)
	at liquibase.Liquibase.runInScope(Liquibase.java:2405)
	at liquibase.Liquibase.update(Liquibase.java:211)
	at liquibase.Liquibase.update(Liquibase.java:197)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1869)
	at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
	at liquibase.Scope.lambda$child$0(Scope.java:180)
	at liquibase.Scope.child(Scope.java:189)
	at liquibase.Scope.child(Scope.java:179)
	at liquibase.Scope.child(Scope.java:158)
	at liquibase.integration.commandline.Main$1.run(Main.java:397)
	at liquibase.integration.commandline.Main$1.run(Main.java:221)
	at liquibase.Scope.child(Scope.java:189)
	at liquibase.Scope.child(Scope.java:165)
	at liquibase.integration.commandline.Main.run(Main.java:221)
	at liquibase.integration.commandline.Main.main(Main.java:164)
Caused by: liquibase.exception.SetupException: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.company.example.liquibase.AssignCampaignsToConsumers
	at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:371)
	at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:318)
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
	... 21 more

Is there already a solution to this problem?

Hi Klaus,
Thanks for the report.

Not sure it can work now, perhaps it requires building the Liquibase classpath diferently.
Created issue.

1 Like

I ran into the same issue. Not sure if anything changed in the mean time considering the original post is already over a year old.

As @klaus noted, this only happens when executing via the liquibase changelog popup. Skipping this popup and running the application as usual will apply the script during startup.

full stack trace

C:/Users/tommo/.jdks/corretto-17.0.14/bin/java liquibase.integration.commandline.Main --driver org.postgresql.Driver --changeLogFile com\agnicio\liquibase\changelog.xml --url jdbc:postgresql://postgres-bicep2.postgres.database.azure.com/agnicioapp --username agnicioappuser --password agnicioAppPassword --logLevel INFO update
####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##                                                ##
####################################################
Starting Liquibase at 21:39:23 using Java 17.0.14 (version 4.29.2 #3683 built at 2024-08-29 16:45+0000)
[2025-05-18 21:39:23] INFO [liquibase.ui] ####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##                                                ##
####################################################
Starting Liquibase at 21:39:23 using Java 17.0.14 (version 4.29.2 #3683 built at 2024-08-29 16:45+0000)
[2025-05-18 21:39:24] INFO [liquibase.database] Set default schema name to public
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/010-init-user.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/01/31-203401-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/01/31-210024-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/01-211458-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/01-224108-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/01-231431-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/01-234826-7871c9de.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/07-002054-d18c4adb.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/08-210505-d18c4adb-rename-tenant-column.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/08-212420-d18c4adb.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/22-223054-d18c4adb.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/23-153516-d18c4adb.xml
[2025-05-18 21:39:24] INFO [liquibase.changelog] Reading resource: com/agnicio/liquibase/changelog/2025/02/23-153523-d18c4adb-chatmessage-markdown-to-html.xml
[2025-05-18 21:39:24] INFO [liquibase.command] Logging exception.
ERROR: Exception Details
[2025-05-18 21:39:24] INFO [liquibase.ui] ERROR: Exception Details
ERROR: Exception Primary Class:  ClassNotFoundException
[2025-05-18 21:39:24] INFO [liquibase.ui] ERROR: Exception Primary Class:  ClassNotFoundException
ERROR: Exception Primary Reason:  com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
[2025-05-18 21:39:24] INFO [liquibase.ui] ERROR: Exception Primary Reason:  com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
ERROR: Exception Primary Source:  PostgreSQL 14.17
[2025-05-18 21:39:24] INFO [liquibase.ui] ERROR: Exception Primary Source:  PostgreSQL 14.17
[2025-05-18 21:39:24] INFO [liquibase.command] Command execution complete
Unexpected error running Liquibase: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
[2025-05-18 21:39:24] INFO [liquibase.ui] Unexpected error running Liquibase: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
For more information, please use the --logLevel flag
[2025-05-18 21:39:24] INFO [liquibase.ui] For more information, please use the --logLevel flag
[2025-05-18 21:39:24] SEVERE [liquibase.integration] Unexpected error running Liquibase: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.command.CommandScope.execute(CommandScope.java:258)
	at liquibase.Liquibase.lambda$update$0(Liquibase.java:216)
	at liquibase.Scope.lambda$child$0(Scope.java:191)
	at liquibase.Scope.child(Scope.java:200)
	at liquibase.Scope.child(Scope.java:190)
	at liquibase.Scope.child(Scope.java:169)
	at liquibase.Liquibase.runInScope(Liquibase.java:1329)
	at liquibase.Liquibase.update(Liquibase.java:205)
	at liquibase.Liquibase.update(Liquibase.java:188)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1566)
	at liquibase.integration.commandline.Main$1.lambda$run$2(Main.java:398)
	at liquibase.Scope.lambda$child$0(Scope.java:191)
	at liquibase.Scope.child(Scope.java:200)
	at liquibase.Scope.child(Scope.java:190)
	at liquibase.Scope.child(Scope.java:169)
	at liquibase.integration.commandline.Main$1.run(Main.java:397)
	at liquibase.integration.commandline.Main$1.run(Main.java:229)
	at liquibase.Scope.child(Scope.java:200)
	at liquibase.Scope.child(Scope.java:176)
	at liquibase.integration.commandline.Main.run(Main.java:229)
	at liquibase.integration.commandline.Main.main(Main.java:165)
Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.lambda$getDatabaseChangeLog$0(DatabaseChangelogCommandStep.java:129)
	at liquibase.Scope.child(Scope.java:200)
	at liquibase.Scope.child(Scope.java:176)
	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.getDatabaseChangeLog(DatabaseChangelogCommandStep.java:128)
	at liquibase.command.core.helpers.DatabaseChangelogCommandStep.run(DatabaseChangelogCommandStep.java:87)
	at liquibase.command.CommandScope.execute(CommandScope.java:220)
	... 20 more
Caused by: liquibase.exception.SetupException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:812)
	at liquibase.changelog.DatabaseChangeLog.handleChildNodeHelper(DatabaseChangeLog.java:545)
	at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:466)
	at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:433)
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
	... 26 more
Caused by: liquibase.exception.LiquibaseException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:1043)
	at liquibase.changelog.DatabaseChangeLog.lambda$includeAll$2(DatabaseChangeLog.java:807)
	at liquibase.Scope.lambda$child$0(Scope.java:191)
	at liquibase.Scope.child(Scope.java:200)
	at liquibase.Scope.child(Scope.java:190)
	at liquibase.Scope.child(Scope.java:169)
	at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:804)
	... 30 more
Caused by: liquibase.exception.ChangeLogParseException: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
	at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:1015)
	... 36 more
Caused by: liquibase.parser.core.ParsedNodeException: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.change.custom.CustomChangeWrapper.load(CustomChangeWrapper.java:312)
	at liquibase.changelog.ChangeSet.toChange(ChangeSet.java:622)
	at liquibase.changelog.ChangeSet.handleChildNode(ChangeSet.java:545)
	at liquibase.changelog.ChangeSet.load(ChangeSet.java:468)
	at liquibase.changelog.DatabaseChangeLog.createChangeSet(DatabaseChangeLog.java:1074)
	at liquibase.changelog.DatabaseChangeLog.handleChildNodeHelper(DatabaseChangeLog.java:476)
	at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:466)
	at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:433)
	at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
	... 37 more
Caused by: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at liquibase.change.custom.CustomChangeWrapper.setClass(CustomChangeWrapper.java:87)
	at liquibase.change.custom.CustomChangeWrapper.load(CustomChangeWrapper.java:310)
	... 45 more
Caused by: java.lang.ClassNotFoundException: com.agnicio.llm.chat.dbmigration.LlmChatMessageMarkdownToHtmlDbMigration
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at liquibase.change.custom.CustomChangeWrapper.setClass(CustomChangeWrapper.java:77)
	... 46 more

Hi @tom.monnier

We resolved this java.lang.ClassNotFoundException issue when running Liquibase update from Studio.
Is it possible that you check your application with CustomTaskChange using latest 2.6-NIGHTLY Studio build? In case there are some other issues in real life custom change execution. So we can try to fix them before stable release is out. Thank you.

Regards,
Alexander