当前位置: 动力学知识库 > 问答 > 编程问答 >

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

网友答案:

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.

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: