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


    一、

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

      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.!~!!

     二.action类里加了一个private int a;给了set和get方法,在前台用${}输出却出现NaN

      检查了下发现前后台代码都没问题,按理说后台只要有set和get方法,前台就能获取它的值啊;又想int类型的好像必须赋初始值,于是在方法里加了个a=0;可是还是NaN

      最后重启服务,重启项目,正常了;   有时候就是这么奇怪,因为缓存或者别的什么原因,出一些莫名的错误,重启,清缓存,重编译试试

      

  • 相关阅读:
    Android最佳性能实践(二)——分析内存的使用情况
    Android最佳性能实践(一)——合理管理内存
    Java反射机制
    Java基础知识总结之IO流
    Java之IO流详解
    CentOS 6.4安装中文支持
    because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.错误应该怎么解决?
    在asp.net添加引用Microsoft.VisualBasic全过程
    SQL SERVER 2012安装介质
    Microsoft SQL Server附加数据库错误:5123
  • 原文地址:https://www.cnblogs.com/xyzq/p/6030556.html
Copyright © 2020-2023  润新知