Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grails dbm-generate-changelog changelog.groovy throws an exception and never finished #149

Open
mangelo123 opened this issue Aug 23, 2018 · 13 comments

Comments

@mangelo123
Copy link

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.

@jameskleeh
Copy link
Contributor

@mangelo123 This is likely specific to your environment. We need steps to reproduce to be able to do anything about it

@mangelo123
Copy link
Author

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.

@jameskleeh
Copy link
Contributor

@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

@mangelo123
Copy link
Author

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"

@jameskleeh
Copy link
Contributor

@mangelo123 Likely the best course of action is to debug the constructor of NumberFormatException and inspect the stacktrace

@mangelo123
Copy link
Author

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.

@jameskleeh
Copy link
Contributor

@mangelo123 If you're using IntelliJ the easiest way is to debug the gradle task.

@mangelo123
Copy link
Author

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?

@mangelo123
Copy link
Author

I should say we are using the 10g Dialect

@mangelo123
Copy link
Author

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.

@mangelo123
Copy link
Author

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?

@mangelo123
Copy link
Author

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

https://github.com/mangelo123/blank.git

@mangelo123
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants