Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Conversation

@dertalai
Copy link

org.hibernate.tool.schema.spi.SchemaManagementException expected instead.

This problem is probably present in newer branches too.

… org.hibernate.tool.schema.spi.SchemaManagementException expected instead.
@CLAassistant
Copy link

CLAassistant commented Feb 24, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

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

This makes sense as m can be null. However, without a test case, I'm not sure what would cause this to occur or what will happen after this change if it occurs.

@dertalai
Copy link
Author

dertalai commented Mar 4, 2025

@matrei, not sure how to help. But I can describe how and why I made this change locally.

I'm using this library within a Grails 5 project. Database is MySQL. When database and entities don't match, I get a NullPointerException during application start, no clue what's happening.

Now, when I controlled this null value, I got a meaninful exception instead. For example: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [table_name].

@matrei
Copy link
Contributor

matrei commented Mar 4, 2025

Thank you @dertalai, that is really good info!

@jamesfredley jamesfredley merged commit eff81e5 into grails:7.2.x Mar 4, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this to Done in Grails 7 Mar 4, 2025
jamesfredley added a commit that referenced this pull request Mar 4, 2025
Fix java.lang.NullPointerException when incorrect schema in database.

(cherry picked from commit eff81e5)
@jdaugherty
Copy link
Contributor

@jamesfredley did you merge this up? the latest version is 9.0.x since we merged the database migration plugin. I didn't think we intended to do older releases in this repo

jdaugherty added a commit that referenced this pull request Mar 5, 2025
Merge pull request #988 from dertalai/7.2.x
@dertalai dertalai deleted the 7.2.x branch March 7, 2025 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants