WILLIAM WOODMAN
WILLIAM WOODMAN

Reputation: 1231

where is dbconsole in grails v3.2.5

doing some dev mode work on grails 3.2.5 but cant find the /dbconsole applet.

i run my app and go the root url and type /dbconsole, and get a 404. I tried editing an entry in application.groovy to ensure it was enabled in dev, and explicitly set the urlRoot, to no effect.

has dbconsole been dropped from latest grails builds, or is it there but hidden ?

i tried variations of this in application groovy and in application.yml, to no effect - always get 404 on the browser

environments {
    production {
        //grails.serverURL = "http://www.changeme.com"
        grails.dbconsole.enabled = true
        grails.dbconsole.urlRoot = '/admin/dbconsole'
    }
    development {
        grails.serverURL = "http://localhost:8080/${appName}"
        grails.dbconsole.enabled = true
        grails.dbconsole.urlRoot = "${appName}/dbc"
    }
    test {
        grails.serverURL = "http://localhost:8080/${appName}"
    }
}

documentation implies it should still work but i am unable to get it to come up

Upvotes: 2

Views: 2098

Answers (4)

Kundan Kumar
Kundan Kumar

Reputation: 1

For Latest version 6.0.0 : [http://localhost:8080/h2-console] is working to open the default db in grails...

Upvotes: 0

Mikhail Gavryuchkov
Mikhail Gavryuchkov

Reputation: 101

It's http://localhost:8080/h2-console now, not http://localhost:8080/dbconsole . At least in the 4.0.x version of Grails.

Upvotes: 6

Valmir Júnior
Valmir Júnior

Reputation: 1

Maybe your Grails app is using a different driver, or serving in another address, take a look at: Database Console session

Upvotes: 0

WILLIAM WOODMAN
WILLIAM WOODMAN

Reputation: 1231

ok i think i have it. I was using Intellij and just imported the project as normal. however i was running the grails-app/init/application to fire up the app. I noticed it said it was in production mode - so the fix for that was top copy the run configuration, and call it "application - dev" or something like that.

you then add a line to the VM args "-Dgrails.env=dev" with this. Now when you run the application by right clicking it shows the new configuration name.

intellij run configuration

once it was back in dev mode, then you could add the default "/dbconsole" after the root screen and it throws the H2 console.

usual caveats apply on security and protection of this url - but back in business and i can see the tables that Gorm is creating on my behalf.

also if you want to use config.slurper formatting as is still shown in the examples, you need to create an application.groovy in grails-app/conf, and put your entries in there, else i guess you transpose to application.yml format, i find groovy code easier to read somehow.

got there in the end

Upvotes: 2

Related Questions