Open mangelo123 opened 6 years ago
@mangelo123 This is likely specific to your environment. We need steps to reproduce to be able to do anything about it
Grails version 3.3.3 Oracle Driver: 'com.oracle:ojdbc6:11.2.0.4.0' Oracle version: 11g (11.2.0.4.0)
This application has been up for at least 2 years. Prior to Liquibase, the db migration plugin worked perfectly. I cannot get passed the first step:
grails dbm-generate-changelog changelog.groovy
I get the errors explained above and never get back to a prompt.
@mangelo123 Unfortunately that isn't enough information to reproduce the issue. We would need a stacktrace that shows where the error is thrown from or the database you are running the command against.
Can you try running the command with the stacktrace flag? --stacktrace
Unfortunately, adding --stacktrace does not produce anymore information:
grails dbm-generate-changelog changelog.groovy --stacktrace
produces:
INFO 8/23/18 12:11 PM: liquibase: Can not use class org.grails.plugins.databasemigration.liquibase.GormDatabase as a Liquibase service because
it does not have a no-argument constructor
Exception: java.lang.NumberFormatException thrown from the UncaughtExceptionHandler in thread "main"
@mangelo123 Likely the best course of action is to debug the constructor of NumberFormatException
and inspect the stacktrace
I cannot even run dbm-status without getting the same errors. How am I able to debug the constructor of NumberFormatException? Is there a command line option that I can have the process enter debug mode? I've tried --debug-jvm, but this has no affect.
@mangelo123 If you're using IntelliJ the easiest way is to debug the gradle task.
I just noticed that we are using Oracle 11g and yet the the Hibernate jar has 9i, 10g, and 12c. I am using the 10g driver. Could this be a possible issue?
I should say we are using the 10g Dialect
I have created a brand new project with only 2 domain classes pointing to the same Oracle DB. The migration is working, however, I am getting this strangeness. Anytime that I do a dbm-gorm-diff, it keeps generating this block at the end:
changeSet(author: "mangelo (generated)", id: "1535053514873-12") {
alterSequence(sequenceName: "hibernate_sequence")
alterSequence(sequenceName: "hibernate_sequence")
alterSequence(sequenceName: "hibernate_sequence")
alterSequence(sequenceName: "hibernate_sequence")
alterSequence(sequenceName: "hibernate_sequence")
}
I have to remove it from the chantgelog file or it fails when I to a dbm-update.
I tried clearing out all domain classes and started out with an empty database again. I copied all of the domain classes over from my main project. Aside from the unique constraint names being too long for most cases, the database was created successfully.
Where else could I possibly look for this NumberFormatException?
I have created an empty project. No domain classes. A few extra entries in build.gradle and I am still getting the NumberFormatException error. This is pointing to a derby db as the default create-app initially sets up. Please try gradlew clean and then grails dbm-generate-changelog changelog.groovy and see if you get the error
And in another development, I tried this with the original project on a Linux server and it ran correctly the first time. This is an odd one for sure.
These messages are produced:
INFO 8/23/18 10:25 AM: liquibase: Can not use class org.grails.plugins.databasemigration.liquibase.GormDatabase as a Liquibase service because it does not have a no-argument constructor Exception: java.lang.NumberFormatException thrown from the UncaughtExceptionHandler in thread "main"
and this never finishes.