title: org.hsqldb.HsqlException: connection exception: connection failure: java.io.EOFException
body: <p>I am using <strong>HSQLDB</strong> with <strong>Hibernate version 4</strong> and <strong>Spring Version 4</strong> in a <strong>maven project</strong>.
  But for the same i am not getting connection object, <strong>getting the following exception.</strong></p>
  
  <pre><code>org.hibernate.exception.GenericJDBCException: Could not open connection
  at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52)
  at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
  at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
  at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)
  at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)
  at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)
  at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)
  at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1263)
  at com.mavenTest.dao.EmpDao.saveData(EmpDao.java:28)
  at com.mavenTest.service.EmpService.saveData(EmpService.java:20)
  at com.mavenTest.controller.LoginController.register(LoginController.java:48)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (connection exception: connection failure: java.io.EOFException)
  at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
  at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
  at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
  at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
  at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276)
  at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297)
  ... 36 more
  Caused by: java.sql.SQLTransientConnectionException: connection exception: connection failure: java.io.EOFException
  at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
  at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
  at org.hsqldb.jdbc.JDBCConnection.&lt;init&gt;(Unknown Source)
  at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
  at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
  at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
  at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
  at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
  at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
  ... 41 more
  Caused by: org.hsqldb.HsqlException: connection exception: connection failure: java.io.EOFException
  at org.hsqldb.error.Error.error(Unknown Source)
  at org.hsqldb.ClientConnection.execute(Unknown Source)
  at org.hsqldb.ClientConnection.&lt;init&gt;(Unknown Source)
  </code></pre>
  
  <p>Whereas i am getting the <strong>SesionFactory</strong> reference, but if I try to get the session reference using <strong>getSessionFactory().openSession()</strong> getting the same error.</p>
  
  <p>The configuration part in xml file as follows:</p>
  
  <pre><code> &lt;!--   =====================================sessionFactory==================================== --&gt;
  
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
           &lt;property name="dataSource" ref="dataSource"/&gt;
           &lt;property name="packagesToScan" value="com.mavenTest.model"/&gt;
            &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;false&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
           &lt;/property&gt;
  
     &lt;/bean&gt;
  
     &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="org.hsqldb.jdbcDriver"/&gt;
          &lt;property name="url" value="jdbc:hsqldb:hsql://localhost"/&gt; &lt;!--  jdbc:hsqldb:mem:. --&gt;
          &lt;property name="username" value="sa"/&gt;
          &lt;property name="password" value=""/&gt;
          &lt;property name="maxActive" value="100000"/&gt;
          &lt;property name="maxIdle" value="30"/&gt;
          &lt;property name="maxWait" value="16000"/&gt;
          &lt;property name="minIdle" value="0"/&gt;
  &lt;/bean&gt;
  
   &lt;!--   =====================================Bean dependency==================================== --&gt;
  
   &lt;bean id="empService" class="com.mavenTest.service.EmpService" autowire="byName"/&gt;
  &lt;bean id="employeeDAO" class="com.mavenTest.dao.EmpDao"  autowire="byName"&gt;
    &lt;property name="sessionFactory"  ref="sessionFactory"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
     
  
  <p>
          
     </p>
  
  <p>I am not getting why the connection is failed. So <strong>Please Guide</strong>, What to be done in this.</p>