{"action":"created","issue":{"url":"https://api.github.com/repos/bjorn/tiled/issues/1028","labels_url":"https://api.github.com/repos/bjorn/tiled/issues/1028/labels{/name}","comments_url":"https://api.github.com/repos/bjorn/tiled/issues/1028/comments","events_url":"https://api.github.com/repos/bjorn/tiled/issues/1028/events","html_url":"https://github.com/bjorn/tiled/issues/1028","id":95691408,"number":1028,"title":"Unable to load map with libtiled-java","user":{"login":"kinglime","id":941516,"avatar_url":"https://avatars.githubusercontent.com/u/941516?v=3","gravatar_id":"","url":"https://api.github.com/users/kinglime","html_url":"https://github.com/kinglime","followers_url":"https://api.github.com/users/kinglime/followers","following_url":"https://api.github.com/users/kinglime/following{/other_user}","gists_url":"https://api.github.com/users/kinglime/gists{/gist_id}","starred_url":"https://api.github.com/users/kinglime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinglime/subscriptions","organizations_url":"https://api.github.com/users/kinglime/orgs","repos_url":"https://api.github.com/users/kinglime/repos","events_url":"https://api.github.com/users/kinglime/events{/privacy}","received_events_url":"https://api.github.com/users/kinglime/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-17T16:21:23Z","updated_at":"2015-07-17T21:28:19Z","closed_at":null,"body":"The following code is not working for me\r\n```java\r\nfinal TMXMapReader reader = new TMXMapReader();\r\nfinal InputStream stream = this.class.getClassLoader().getResourceAsStream(\"maps/level_1.tmx\");\r\nfinal Map map;\r\ntry {\r\n    map = reader.readMap(stream);\r\n} catch (Exception e) {\r\n    e.printStackTrace();\r\n}\r\n```\r\nI am getting the following error:\r\n```\r\n[Fatal Error] :1:1: Content is not allowed in prolog.\r\norg.xml.sax.SAXParseException; systemId: file:/C:/Users/Robert/IdeaProjects/platform-game/./; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.\r\n\tat com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:348)\r\n\tat tiled.io.TMXMapReader.unmarshal(Unknown Source)\r\n\tat tiled.io.TMXMapReader.readMap(Unknown Source)\r\n\tat me.robertmaes.platform_game.Game.<init>(Game.java:70)\r\n\tat me.robertmaes.platform_game.Game.main(Game.java:92)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)\r\njava.lang.Exception: Error while parsing map file: org.xml.sax.SAXParseException; systemId: file:/C:/Users/Robert/IdeaProjects/platform-game/./; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.\r\n\tat tiled.io.TMXMapReader.unmarshal(Unknown Source)\r\n\tat tiled.io.TMXMapReader.readMap(Unknown Source)\r\n\tat me.robertmaes.platform_game.Game.<init>(Game.java:70)\r\n\tat me.robertmaes.platform_game.Game.main(Game.java:92)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)\r\n```\r\n\r\nI have already verified the stream is loading correctly. What am I doing wrong here?\r\n\r\nAlso, here is the source of the file I am trying to load:\r\n\r\n```xml\r\n<xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<map version=\"1.0\" orientation=\"orthogonal\" renderorder=\"right-down\" width=\"25\" height=\"20\" tilewidth=\"32\" tileheight=\"32\" nextobjectid=\"16\">\r\n <tileset firstgid=\"1\" name=\"tiles\" tilewidth=\"32\" tileheight=\"32\">\r\n  <image source=\"../textures/tiles.png\" width=\"320\" height=\"320\"/>\r\n </tileset>\r\n <imagelayer name=\"Background Image\">\r\n  <image source=\"../textures/background.png\"/>\r\n </imagelayer>\r\n <layer name=\"Background Tiles\" width=\"25\" height=\"20\">\r\n  <data encoding=\"base64\" compression=\"zlib\">\r\n   eJzjYGBg4ABiaSSMjc+BJk4sG5teWtpBD0yqP3Cpp2ZYkWIHOx0xNvfBMLHq8OkbDJgFhxguzI7GJgQkiFBDjB4+GuJRO0btAGEpNHoo+WM4AACJ2xaV\r\n  </data>\r\n </layer>\r\n <layer name=\"Foreground Tiles\" width=\"25\" height=\"20\">\r\n  <data encoding=\"base64\" compression=\"zlib\">\r\n   eJzVk0sKwzAMRCdJuwg09LcogRyuR+tRawcLjLGlUU0WFbxVZjQWUhYAM8FC6mq+CFNRdye1pS8yEYgOpD73eeaYO+ZgtWNiMrS1jN6dw/B55gB8u2jt4xl4KBmi0Ur8ecYrcGqQZ2yBs9G/9raLAQiN5Rmw38rH+Ty15O5C3/dwYMbNmXF19pc6Yo7y32Qz5M6tnjXNr3NomVpGytlZ0/e1ZXRUmdFi7IDp/098AciFDG4=\r\n  </data>\r\n </layer>\r\n <objectgroup name=\"Objects\">\r\n  <object id=\"13\" name=\"Start\" x=\"47\" y=\"272.5\"/>\r\n  <object id=\"15\" name=\"Finish\" x=\"367\" y=\"49\"/>\r\n </objectgroup>\r\n</map>\r\n```"},"comment":{"url":"https://api.github.com/repos/bjorn/tiled/issues/comments/122422682","html_url":"https://github.com/bjorn/tiled/issues/1028#issuecomment-122422682","issue_url":"https://api.github.com/repos/bjorn/tiled/issues/1028","id":122422682,"user":{"login":"kinglime","id":941516,"avatar_url":"https://avatars.githubusercontent.com/u/941516?v=3","gravatar_id":"","url":"https://api.github.com/users/kinglime","html_url":"https://github.com/kinglime","followers_url":"https://api.github.com/users/kinglime/followers","following_url":"https://api.github.com/users/kinglime/following{/other_user}","gists_url":"https://api.github.com/users/kinglime/gists{/gist_id}","starred_url":"https://api.github.com/users/kinglime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinglime/subscriptions","organizations_url":"https://api.github.com/users/kinglime/orgs","repos_url":"https://api.github.com/users/kinglime/repos","events_url":"https://api.github.com/users/kinglime/events{/privacy}","received_events_url":"https://api.github.com/users/kinglime/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T21:28:19Z","updated_at":"2015-07-17T21:28:19Z","body":"@bjorn I tried my hand at fixing the objects with floating point positions. #1029"}}