我使用Grails 3.3.2
使用intellij
IDE,当我尝试运行我的应用程序时出现以下错误:
Error |
Error occurred running Grails CLI: expected '<document start>', but found
BlockMappingStart
in 'reader', line 105, column 1:
hibernate:
这是从application.yml
文件生成的,这是抱怨的部分:
endpoints:
enabled: false
jmx:
enabled: true
---
mime:
disable:
accept:
header:
userAgents:
- Gecko
- WebKit
- Presto
- Trident
# converters:
# encoding : UTF-8
exceptionresolver:
params:
exclude:
- password
- creditCard
types:
all: '*/*'
atom: application/atom+xml
css: text/css
csv: text/csv
form: application/x-www-form-urlencoded
html:
- text/html
- application/xhtml+xml
js: text/javascript
json:
- application/json
- text/json
multipartForm: multipart/form-data
pdf: application/pdf
rss: application/rss+xml
text: text/plain
hal:
- application/hal+json
- application/hal+xml
xml:
- text/xml
- application/xml
urlmapping:
cache:
maxsize: 1000
controllers:
defaultScope: singleton
converters:
encoding: UTF-8
views:
default:
codec: html
gsp:
encoding: UTF-8
htmlcodec: xml
codecs:
expression: html
scriptlets: html
taglib: none
staticparts: none
# endpoints:
# jmx:
# unique-names: true
# logging:
# config: '../config/logback.groovy' #${userHome}
#----------------------------------------------------------------------------------------------------------
# DB configs
hibernate: // this is the line it's complaining about
cache:
# queries: false
use_second_level_cache: false
use_query_cache: false
dataSource:
pooled: true
jmxExport: true
# driverClassName: org.h2.Driver
# username: sa
# password: ''
environments:
development:
dataSource:
dbCreate: create-drop
# url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
driverClassName: com.mysql.jdbc.Driver
username: myusername
password: mypassword
url: jdbc:mysql://127.0.0.1/DB_New
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: none
# url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
jndiName : "jdbc/mysqlDBConnLocal"
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
#--------------------------------------------
可能导致此错误的原因是什么?什么都错过了?有没有办法在yml
或任何其他应用程序中格式化intellij
文件,可以帮助我格式化yml
个文件。