title: postgres: Error querying database
body: <p>Project run for some time after the database connection is not found, the error message is as follows：</p>
  
  <p>2017-05-02 10:02:17,224 ERROR [main] (line:com.unis.license.agent.management.aop.ManagementServicesAop.afterThrowing(ManagementServicesAop.java:47)) - BeforeMethod:com.unis.license.agent.management.service.impl.LicenseServiceImpl.loadLicenseInfo       Params: []
  2017-05-02 10:02:17,225 ERROR [main] (line:com.unis.license.agent.management.aop.ManagementServicesAop.afterThrowing(ManagementServicesAop.java:50)) - methodException:com.unis.license.agent.management.service.impl.LicenseServiceImpl.loadLicenseInfo  Exception:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:</p>
  
  <h3>Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: the database system is starting up)</h3>
  
  <h3>The error may exist in licenseAgent/orm/LicenseInfo.xml</h3>
  
  <h3>The error may involve com.unis.license.agent.management.dao.ILicenseInfoOper.getAll</h3>
  
  <h3>The error occurred while executing a query</h3>
  
  <h3>Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: the database system is starting up)</h3>
  
  <p>2017-05-02 10:02:17,226 ERROR [main] (line:org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:318)) - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.unis.license.agent.management.filter.Initialization#0' defined in class path resource [spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.NoTransactionException: No transaction aspect-managed TransactionStatus in scope
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
          at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
          at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:799)
          at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:446)
          at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
          at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:296)
          at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1347)
          at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:743)
          at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
          at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:117)
          at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:99)
          at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
          at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:154)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)</p>
  
  <p>My DataSource configuration information is as follows：</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName" value="org.postgresql.Driver"&gt;&lt;/property&gt;
      &lt;property name="url" value="jdbc:postgresql://127.0.0.1:5432/ucsm"&gt;&lt;/property&gt; 
      &lt;property name="username" value="uqdm"&gt;&lt;/property&gt;
      &lt;property name="password" value="unis123"&gt;&lt;/property&gt;
      &lt;property name="maxActive" value="100"&gt;&lt;/property&gt;
      &lt;property name="maxIdle" value="30"&gt;&lt;/property&gt;
      &lt;property name="maxWait" value="500"&gt;&lt;/property&gt;
      &lt;property name="defaultAutoCommit" value="true"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="transactionManager"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  
  &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
      &lt;property name="configLocation" value="classpath:licenseAgent/mybatiscfg.xml"&gt;&lt;/property&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt; 
  &lt;bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;
      &lt;property name="basePackage" value="com.unis.license.agent.management.dao" /&gt;
  &lt;/bean&gt;
  </code></pre>