"sequence entries are not allowed here"

1,625 views
Skip to first unread message

Todd Gochenour

unread,
Sep 25, 2011, 11:00:00 PM9/25/11
to play-framework
I just saw this in the tutorial which answers my question as to why a
private constructor.

[quote]
Because we want something like lazy tags creation we will always get
them using the findOrCreateByName(String name) factory method.
[/quote]

Todd Gochenour

unread,
Sep 25, 2011, 6:54:27 PM9/25/11
to play-framework
Following the step-by-step tutorial, I got stuck at the point where
tags are added to the initial data YML file. In the documentation for
guide 6 (http://www.playframework.org/documentation/1.0.1/guide6), it
says:

[quote]
You need to restart your application to force loading the new initial
data set. Note how play tells you problems even in YAML files
[/quote]

and then presents a screenshot of the browser reporting error

[quote]
Malformed YAML
Cannot parse the /conf/initial-data.yml file: sequence entries are not
allowed here
[/quote]

But then the tutorial provides no mechanism for correcting the error.
Instead it moves on to:

[quote]
Then modify the #{display /} tag to show the tag set on the full post
view. Edit the /yabe/app/views/tags/display/html file
[/quote]

which has nothing to do with the initial data.

I get the exception:

[quote]
16:47:26,421 ERROR ~

@67p6p2b9e
Internal Server Error (500) for request GET /posts/1

Malformed YAML (In /conf/initial-data.yml around line 52)
Cannot parse the /conf/initial-data.yml file: sequence entries are not
allowed h
ere

play.exceptions.YAMLException: null; sequence entries are not allowed
here (in f
ile /conf/initial-data.yml line 52, column 21)
at play.test.Fixtures.loadModels(Fixtures.java:221)
at Bootstrap.doJob(Bootstrap.java:13)
at play.jobs.Job.doJobWithResult(Job.java:50)
at play.jobs.Job.call(Job.java:146)
at Invocation.Job(Play!)
Caused by: sequence entries are not allowed here
in "<reader>", line 52, column 21:
tags: - play
^

at
org.yaml.snakeyaml.scanner.ScannerImpl.fetchBlockEntry(ScannerImpl.ja
va:661)
at
org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.ja
va:264)
at
org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:18
3)
at org.yaml.snakeyaml.parser.ParserImpl
$ParseBlockMappingValue.produce(P
arserImpl.java:592)
at
org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
at
org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
at
org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:132)
at
org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
:230)
at
org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
at
org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
:230)
at
org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
at
org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:12
2)
at
org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)

at
org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCons
tructor.java:124)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:238)
at play.test.Fixtures.loadModels(Fixtures.java:176)
... 4 more
[/quote]

How should this be fixed?

Todd Gochenour

unread,
Sep 25, 2011, 7:20:19 PM9/25/11
to play-framework
The Tag class constructor is private. Should it be public?

I kept starting and stopping and switching from play test to play run
and then realized that the URL from the last run was "http://localhost:
9000/posts/1" but the tags were listed on on the post "http://
localhost:9000/posts/3" and now I see the tags listed in the
presentation. I can move on in the tutorial now.
Reply all
Reply to author
Forward
0 new messages