jt_s8645 2018-04-27 03:02 采纳率: 45.5%
浏览 1518
已采纳

项目部署后第二天报错:MySQL数据路连接异常

我的项目用的是MySQL数据库,部署到服务器上后,第二天就报这个错误,哪位大神有解决办法,
[2018-04-27 09:38:48] [http-bio-8080-exec-5] [ERROR] com.manage.controller.appcontrol.AppUserController :手机号登录验证异常:com.manage.exception.AtomException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

The error may exist in file [/usr/tomcat/apache-tomcat-7.0.82/webapps/Tophotoart/WEB-INF/classes/com/manage/dao/mapper/TopUserMapper.xml]

The error may involve com.manage.dao.TopUserMapper.getAppExternalUser

The error occurred while executing a query

SQL: SELECT us.userId,us.nickname,us.realName, us.sexId, us.birthday,us.avatar,us.phone FROM topuser AS us WHERE us.userType=0 and us.phone=?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

; SQL []; No operations allowed after connection closed.; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
[com.manage.controller.appcontrol.AppUserController] [手机号登录验证异常:com.manage.exception.AtomException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

The error may exist in file [/usr/tomcat/apache-tomcat-7.0.82/webapps/Tophotoart/WEB-INF/classes/com/manage/dao/mapper/TopUserMapper.xml]

The error may involve com.manage.dao.TopUserMapper.getAppExternalUser

The error occurred while executing a query

SQL: SELECT us.userId,us.nickname,us.realName, us.sexId, us.birthday,us.avatar,us.phone FROM topuser AS us WHERE us.userType=0 and us.phone=?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

; SQL []; No operations allowed after connection closed.; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.]

  • 写回答

11条回答 默认 最新

  • xwh1314 2018-05-05 02:53
    关注

    不行就试试这个,

         <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
            <property name="driverClass" value="${database.driver}"/>
            <property name="jdbcUrl" value="${database.url}"/>
            <property name="user" value="${database.username}"/>
            <property name="password" value="${database.password}"/>
            <property name="minPoolSize" value="1"/>
            <property name="maxPoolSize" value="20"/>
            <property name="maxIdleTime" value="1800"/>
            <property name="acquireIncrement" value="2"/>
            <property name="maxStatements" value="0"/>
            <property name="initialPoolSize" value="2"/>
            <property name="idleConnectionTestPeriod" value="1800"/>
            <property name="acquireRetryAttempts" value="30"/>
            <property name="breakAfterAcquireFailure" value="true"/>
            <property name="testConnectionOnCheckout" value="false"/>
        </bean>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(10条)

报告相同问题?

悬赏问题

  • ¥15 为什么apriori的运行时间会比fp growth的运行时间短呢
  • ¥15 帮我解决一下膳食平衡的线性规划模型的数据实例
  • ¥40 万年历缺少农历,需要和阳历同时显示
  • ¥250 雷电模拟器内存穿透、寻基址和特征码的教学
  • ¥200 比特币ord程序wallet_constructor.rs文件支持一次性铸造1000个代币,并将它们分配到40个UTXO上(每个UTXO上分配25个代币),并设置找零地址
  • ¥15 关于Java的学习问题
  • ¥15 如何使用chatgpt完成文本分类任务?
  • ¥15 已知速度v关于位置s的等式,怎么转化为已知位置求速度v的等式
  • ¥15 我有个餐饮系统,用wampserver把环境配置好了,但是后端的网页却进去,是为什么,能不能帮远程一下?
  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"