Grails
  1. Grails
  2. GRAILS-7885

The 'console' command hangs when Groovy console is closed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-M1
    • Fix Version/s: 2.3-RC1
    • Component/s: None
    • Labels:
      None

      Description

      In a 2.0 project, run the grails console command. Now quit the console. The command stays running in the background and can only be stopped with a Ctrl-C. That's not fun if you're in interactive mode since it drops you back to your OS terminal!

        Activity

        Hide
        Raviteja added a comment -

        I have faced a much weirder issue. I haven't closed grails console properly while I was using 1.3.7 and it(GUI) never was visible again.

        Show
        Raviteja added a comment - I have faced a much weirder issue. I haven't closed grails console properly while I was using 1.3.7 and it(GUI) never was visible again.
        Hide
        Philippe RT added a comment -

        Hello,

        I've got the same issue too.

        I play with GORM, and sometimes, the script hang. So I stop it and I have the exception :

        2012-03-16 08:44:18,876 [Thread-52] ERROR util.JDBCExceptionReporter - Cannot get a connection, general error
        2012-03-16 08:44:18,899 [Thread-52] ERROR util.JDBCExceptionReporter - Cannot get a connection, general error
        Exception thrown

        org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not inspect JDBC autocommit mode; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot get a connection, general error; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, general error
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
        at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
        at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
        at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512)
        at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506)
        at org.springframework.orm.hibernate3.HibernateOperations$get.call(Unknown Source)
        at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
        at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
        at $Proxy20.doInHibernate(Unknown Source)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
        at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
        at fr.compagniedesalpes.jdv.Application.read(Application.groovy)
        at fr.compagniedesalpes.jdv.Application$read.call(Unknown Source)
        at ConsoleScript10.run(ConsoleScript10:3)
        at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
        at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
        Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, general error
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:118)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
        at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:224)
        at $Proxy16.getAutoCommit(Unknown Source)
        at org.hibernate.jdbc.ConnectionManager.isAutoCommit(ConnectionManager.java:212)
        at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:287)
        at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:595)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1010)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
        at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
        ... 15 more
        Caused by: java.lang.InterruptedException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:502)
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1115)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
        ... 26 more

        After, the console stops to work. When I want to close it, it hangs.

        If it can help...

        Thanks.

        Show
        Philippe RT added a comment - Hello, I've got the same issue too. I play with GORM, and sometimes, the script hang. So I stop it and I have the exception : 2012-03-16 08:44:18,876 [Thread-52] ERROR util.JDBCExceptionReporter - Cannot get a connection, general error 2012-03-16 08:44:18,899 [Thread-52] ERROR util.JDBCExceptionReporter - Cannot get a connection, general error Exception thrown org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not inspect JDBC autocommit mode; uncategorized SQLException for SQL [???] ; SQL state [null] ; error code [0] ; Cannot get a connection, general error; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, general error at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:512) at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:506) at org.springframework.orm.hibernate3.HibernateOperations$get.call(Unknown Source) at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231) at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231) at $Proxy20.doInHibernate(Unknown Source) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231) at fr.compagniedesalpes.jdv.Application.read(Application.groovy) at fr.compagniedesalpes.jdv.Application$read.call(Unknown Source) at ConsoleScript10.run(ConsoleScript10:3) at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231) at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231) Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, general error at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:118) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:224) at $Proxy16.getAutoCommit(Unknown Source) at org.hibernate.jdbc.ConnectionManager.isAutoCommit(ConnectionManager.java:212) at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:287) at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:595) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1010) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998) at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:519) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) ... 15 more Caused by: java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:502) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1115) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) ... 26 more After, the console stops to work. When I want to close it, it hangs. If it can help... Thanks.
        Hide
        Imran Sarwar added a comment -

        I'm facing the same issue as Philippe, and it happens too often

        Thanks

        Show
        Imran Sarwar added a comment - I'm facing the same issue as Philippe, and it happens too often Thanks
        Hide
        Peter Ledbrook added a comment -

        For those having problems with SQL exceptions, are you running with grails -reloading console?

        Show
        Peter Ledbrook added a comment - For those having problems with SQL exceptions, are you running with grails -reloading console ?
        Hide
        Graeme Rocher added a comment -

        This is not an issue in 2.3 and the console is forked into a separate JVM

        Show
        Graeme Rocher added a comment - This is not an issue in 2.3 and the console is forked into a separate JVM

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Peter Ledbrook
          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development