码迷,mamicode.com
首页 > 其他好文 > 详细

开发问题汇集-------菜鸟的菜,菜鸟的鸟

时间:2016-11-04 16:50:12      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:pst   统一   nec   dstat   解决办法   开发   设置   insert   tin   

一、

  最近做一个常用表单上传下载模块,本机测试没问题,在测试系统测又出问题,好不容易测试系统没问题了,生产系统那边又有问题了。。。。真是环环相扣,丁点不能错啊!!!

  1.生产系统遇到的第一个问题

    [ERROR] 2016-11-04 09:26:37,680 method:gnhr.ww.json.CommonFileAction.list(CommonFileAction.java:193)
    CommonFileAction Exception
    com.microsoft.sqlserver.jdbc.SQLServerException: 对象名 ‘CommonFile‘ 无效。
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)    

    原因:

      本地和测试系统的数据库跟生产系统的数据库不是同一个,生产系统的数据库里没CommonFile这个表

    解决办法:

      在生产系统的数据库新建一个和本地及测试系统一样的表CommonFile

  2.生产系统遇到的第二个问题

     2016-11-04 10:35:58,584 method:gnhr.dao.helper.BasicCommonFileHelper.pstmtInsert(BasicCommonFileHelper.java:223)
    CommonFileHelper.pstmtInsert SQLException
    com.microsoft.sqlserver.jdbc.SQLServerException: 不能将值 NULL 插入列 ‘FileId‘,表 ‘Gn_Hr.dbo.CommonFile‘;列不允许有空值。INSERT 失败。
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)

  原因:

    CommonFile这个表里的主键FileId在本地和测试系统是设置为自增长,非空的,而生产系统的某某却没设置为自增长。

  解决:

    把生产系统的CommonFile表的FileId字段也设置成自增。

  ohyea.!~!!

 

开发问题汇集-------菜鸟的菜,菜鸟的鸟

标签:pst   统一   nec   dstat   解决办法   开发   设置   insert   tin   

原文地址:http://www.cnblogs.com/xyzq/p/6030556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!