Menu

#30 'End of document expected' exception thrown for valid docume

open
nobody
None
5
2008-01-10
2008-01-10
No

Yaml.load() throws 'End of document expected' exeption for valid document.

Code:

public static void main(String[] args) throws IOException {
String input = ""
+ "- &m1\n"
+ " foo\n"
+ "- bar\n"
;
Object ydoc = Yaml.load(input);
}

Result:

Exception in thread "main" org.ho.yaml.exception.YamlException: Error near line 3: End of document expected.
at org.ho.yaml.JYamlParserEvent.error(Unknown Source)
at org.ho.yaml.YamlDecoder.firstDocument(Unknown Source)
at org.ho.yaml.YamlDecoder.readObject(Unknown Source)
at org.ho.yaml.YamlConfig.load(Unknown Source)
at org.ho.yaml.YamlConfig.load(Unknown Source)
at org.ho.yaml.YamlConfig.load(Unknown Source)
at org.ho.yaml.Yaml.load(Unknown Source)
at net.example.JYamlExample2.main(JYamlExample2.java:14)

Discussion


Log in to post a comment.