hibernate - No value for key bound to thread (Grails) -
i'm developing web application grails. environment specs are:
- groovy grails tool suite (ggts) 3.6.0.m1-e4.4-win32-x86_64
- hibernate 4.3.5.3
- groovy 2.3
- grails 2.4.0
- windows 8.1 pro n
i start application, , on grails start page choose controller:
class uploadcontroller { def index() { } def upload() { forward(controller: "parser", action: "takeuploadedfiles") } }
with controller there not happen anything. corresponding .gsp upload form. use upload multiple files @ once.
<%@ page contenttype="text/html;charset=utf-8" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> <meta name="layout" content="main"/> <title>inhalte einlesen</title> </head> <body> <div class="body"> <g:uploadform controller="upload" action="upload" autocomplete="off"> <label for="files">bitte alle html-dateien einer kategorie auswählen:</label> <input type="file" id="files" name="files" multiple="multiple" /> <input type="hidden" id="max_file_size" name="max_file_size" value="30000" /> <g:submitbutton name="add" class="save button medium" value="hochladen" /> </g:uploadform> </div> </body> </html>
the uploadcontroller forwards parsercontroller. parsercontroller:
import org.springframework.web.multipart.commons.commonsmultipartfile class parsercontroller { def multiparttofileservice def parserservice def index() { } def takeuploadedfiles() { list filelist = request.getfiles('files') // 'files' name of input filelist.each { file -> multiparttofileservice.convert(file) } redirect(action: "parse") } def parse() { parserservice.parse() } }
so upload 1 .html. @ point exception:
2014-06-02 23:04:33,127 [tomcat-http--9] error servlet.grailsdispatcherservlet - handlerinterceptor.aftercompletion threw exception java.lang.illegalstateexception: no value key [org.hibernate.internal.sessionfactoryimpl@6398813a] bound thread [tomcat-http--9] @ grails.plugin.cache.web.filter.pagefragmentcachingfilter.dofilter(pagefragmentcachingfilter.java:198) @ grails.plugin.cache.web.filter.abstractfilter.dofilter(abstractfilter.java:63) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745)
this exception doesn't stop application, parsing done perfectly. don't understand exception, , found out might have transactional services i'm injecting in pasercontroller. whithout service injection, don't exception (instead missingpropertyexception, of course):
import org.springframework.web.multipart.commons.commonsmultipartfile class parsercontroller { // def multiparttofileservice // def parserservice def index() { } def takeuploadedfiles() { list filelist = request.getfiles('files') // 'files' name of input filelist.each { file -> multiparttofileservice.convert(file) } redirect(action: "parse") } def parse() { parserservice.parse() } }
any ideas how avoid illegalstateexception?
this seems problem: https://github.com/grails/grails-core/issues/2105
- id: grails-11481
- description: grailsdispatcherservlet throws illegalstateexception when using forward() , render()
Comments
Post a Comment