我正在构建一个intial-data.yml
文件来测试我的Play!应用程序,但是当我尝试加载页面时,在通过intial-data.yml
文件读取时出现错误。这似乎能够解析的用户名,名字,和姓氏字段,但是当它到达的电子邮件,它吐出以下错误:为什么initial-data.yml不允许映射电子邮件的值?
play.exceptions.YAMLException: null; mapping values are not allowed here (in file /conf/initial-data.yml line 7, column 11)
at play.test.Fixtures.loadModels(Fixtures.java:234)
at Bootstrap.doJob(Bootstrap.java:12)
at play.jobs.Job.doJobWithResult(Job.java:50)
at play.jobs.Job.call(Job.java:146)
at Invocation.Job(Play!)
Caused by: mapping values are not allowed here
in "<reader>", line 7, column 11:
email: [email protected]
^
在我的YML文件的第一项如下所示:
# Test data
User(Dan):
username: Username1
fname: John
lname: Doe
email: [email protected]
password: password1
有没有人知道为什么会发生这种情况?
也参看:http: //stackoverflow.com/questions/9055371/python-and-pyaml-yaml-scanner-scannererror-mapping-values-are-not-allowed-her – DNA 2012-02-18 23:57:20