在PSQLException上运行grails app失败:此ResultSet已关闭

时间:2017-11-28 12:39:13

标签: postgresql docker grails intellij-idea jdbc

我正在尝试在终端中运行本地grails应用程序(好吧,在Pycharm中),它失败了:

    [WARN] 2017-11-28 13:16:26,836 (springframework.jdbc.datasource.LazyConnectionDataSourceProxy:warn:189) | Could not retrieve default auto-commit and transaction isolation settings
org.postgresql.util.PSQLException: This ResultSet is closed.
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2ResultSet.java:2852)
        at org.postgresql.jdbc2.AbstractJdbc2ResultSet.setFetchSize(AbstractJdbc2ResultSet.java:1875)
        at org.postgresql.jdbc4.Jdbc4Statement.createResultSet(Jdbc4Statement.java:37)
        at org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler.handleResultRows(AbstractJdbc2Statement.java:219)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1816)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.execSQLUpdate(AbstractJdbc2Connection.java:376)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.getTransactionIsolation(AbstractJdbc2Connection.java:898)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
        at org.eclipse.jetty.server.Server.doStart(Server.java:261)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
        at org.grails.jetty.JettyServer.startServer(JettyServer.groovy:134)
        at org.grails.jetty.JettyServer.start(JettyServer.groovy:99)
        at _GrailsRun$_run_closure1.doCall(_GrailsRun.groovy:60)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
[WARN] 2017-11-28 13:16:27,152 (engine.jdbc.internal.JdbcServicesImpl:configure:195) | HHH000341: Could not obtain connection metadata : This ResultSet is closed.
[WARN] 2017-11-28 13:16:27,165 (grails.commons.spring.GrailsWebApplicationContext:warn:189) | Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1214)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
        at org.eclipse.jetty.server.Server.doStart(Server.java:261)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
        at org.grails.jetty.JettyServer.startServer(JettyServer.groovy:134)
        at org.grails.jetty.JettyServer.start(JettyServer.groovy:99)
        at _GrailsRun$_run_closure1.doCall(_GrailsRun.groovy:60)
        at RunApp$_run_closure1.doCall(RunApp.groovy:33)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
        ... 13 more

我在docker中运行了postgres实例。 grails的版本是2.4.5。 我有Mac OS。我支持代理。

之前已成功编译grails并且还通过了一些测试。

不幸的是,我不知道可能出现什么问题,我应该尝试什么。我不知道该找什么。 我会很高兴任何建议寻找方向! 谢谢! :)

0 个答案:

没有答案