{"action":"created","issue":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1061","labels_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1061/labels{/name}","comments_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1061/comments","events_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1061/events","html_url":"https://github.com/restlet/restlet-framework-java/issues/1061","id":71737519,"number":1061,"title":"Template (thymeleaf) parse error produces never ending request (headers already sent)","user":{"login":"notz","id":697251,"avatar_url":"https://avatars.githubusercontent.com/u/697251?v=3","gravatar_id":"","url":"https://api.github.com/users/notz","html_url":"https://github.com/notz","followers_url":"https://api.github.com/users/notz/followers","following_url":"https://api.github.com/users/notz/following{/other_user}","gists_url":"https://api.github.com/users/notz/gists{/gist_id}","starred_url":"https://api.github.com/users/notz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notz/subscriptions","organizations_url":"https://api.github.com/users/notz/orgs","repos_url":"https://api.github.com/users/notz/repos","events_url":"https://api.github.com/users/notz/events{/privacy}","received_events_url":"https://api.github.com/users/notz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Extension:%20Thymeleaf","name":"Extension: Thymeleaf","color":"fbca04"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Module:%20Restlet%20Engine","name":"Module: Restlet Engine","color":"fbca04"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Priority:%20high","name":"Priority: high","color":"eb6420"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/State:%20analysis","name":"State: analysis","color":"009800"},{"url":"https://api.github.com/repos/restlet/restlet-framework-java/labels/Type:%20bug","name":"Type: bug","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-28T23:37:35Z","updated_at":"2015-05-01T13:20:22Z","closed_at":null,"body":"Connection should be closed on IO Exception.\r\n\r\n```\r\n[ERROR] Restlet-1925314656 org.thymeleaf.TemplateEngine:1085 process \r\n[THYMELEAF][Restlet-1925314656] Exception processing template \"index\": Exception parsing document: template=\"index\", line 76 - column 4\r\nUnable to process the template\r\n\r\norg.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template=\"index\", line 76 - column 4\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:167)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplate(AbstractNonValidatingSAXTemplateParser.java:117)\r\n\tat org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:277)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:955)\r\n\tat org.restlet.ext.thymeleaf.TemplateRepresentation.write(TemplateRepresentation.java:377)\r\n\tat org.restlet.representation.CharacterRepresentation.write(CharacterRepresentation.java:67)\r\n\tat org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:510)\r\n\tat org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:454)\r\n\tat org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187)\r\n\tat org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)\r\n\tat org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)\r\n\tat sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:677)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:649)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: org.xml.sax.SAXParseException; lineNumber: 76; columnNumber: 4; The element type \"meta\" must be terminated by the matching end-tag \"</meta>\".\r\n\tat com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)\r\n\tat com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)\r\n\tat com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.doParse(AbstractNonValidatingSAXTemplateParser.java:210)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:134)\r\n\t... 22 more\r\norg.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template=\"index\", line 76 - column 4\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:167)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplate(AbstractNonValidatingSAXTemplateParser.java:117)\r\n\tat org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:277)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011)\r\n\tat org.thymeleaf.TemplateEngine.process(TemplateEngine.java:955)\r\n\tat org.restlet.ext.thymeleaf.TemplateRepresentation.write(TemplateRepresentation.java:377)\r\n\tat org.restlet.representation.CharacterRepresentation.write(CharacterRepresentation.java:67)\r\n\tat org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:510)\r\n\tat org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:454)\r\n\tat org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187)\r\n\tat org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)\r\n\tat org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)\r\n\tat sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:677)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:649)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: org.xml.sax.SAXParseException; lineNumber: 76; columnNumber: 4; The element type \"meta\" must be terminated by the matching end-tag \"</meta>\".\r\n\tat com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)\r\n\tat com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)\r\n\tat com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)\r\n\tat com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)\r\n\tat com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)\r\n\tat com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.doParse(AbstractNonValidatingSAXTemplateParser.java:210)\r\n\tat org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:134)\r\n\t... 22 more\r\nAn exception occured writing the response entity\r\n\r\njava.io.IOException: Template processing error. Exception parsing document: template=\"index\", line 76 - column 4\r\n\tat org.restlet.ext.thymeleaf.TemplateRepresentation.write(TemplateRepresentation.java:390)\r\n\tat org.restlet.representation.CharacterRepresentation.write(CharacterRepresentation.java:67)\r\n\tat org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:510)\r\n\tat org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:454)\r\n\tat org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:187)\r\n\tat org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)\r\n\tat org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)\r\n\tat sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:677)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:649)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nUnable to send error response\r\n\r\njava.io.IOException: headers already sent\r\n\tat sun.net.httpserver.ExchangeImpl.sendResponseHeaders(ExchangeImpl.java:204)\r\n\tat sun.net.httpserver.HttpExchangeImpl.sendResponseHeaders(HttpExchangeImpl.java:86)\r\n\tat org.restlet.engine.connector.HttpExchangeCall.writeResponseHead(HttpExchangeCall.java:161)\r\n\tat org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:450)\r\n\tat org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:205)\r\n\tat org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)\r\n\tat org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:64)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)\r\n\tat sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:677)\r\n\tat com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)\r\n\tat sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:649)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/comments/98132109","html_url":"https://github.com/restlet/restlet-framework-java/issues/1061#issuecomment-98132109","issue_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1061","id":98132109,"user":{"login":"thboileau","id":1122782,"avatar_url":"https://avatars.githubusercontent.com/u/1122782?v=3","gravatar_id":"","url":"https://api.github.com/users/thboileau","html_url":"https://github.com/thboileau","followers_url":"https://api.github.com/users/thboileau/followers","following_url":"https://api.github.com/users/thboileau/following{/other_user}","gists_url":"https://api.github.com/users/thboileau/gists{/gist_id}","starred_url":"https://api.github.com/users/thboileau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thboileau/subscriptions","organizations_url":"https://api.github.com/users/thboileau/orgs","repos_url":"https://api.github.com/users/thboileau/repos","events_url":"https://api.github.com/users/thboileau/events{/privacy}","received_events_url":"https://api.github.com/users/thboileau/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T13:20:22Z","updated_at":"2015-05-01T13:20:22Z","body":"Thanks for reporting this issue. I see several issues, the one you point (never ending request), the fact that the error response cannot be sent properly (message `headers already sent`).\r\n\r\nFor a production environment, I suggest, as a side note and not as a workaround, to use another server connector (such as the one based on Jetty `org.restlet.ext.jetty`, or simple `org.restlet.ext.simple`). Your code won't change at all, just update the classpath in order to add the extension ans its dependency."}}