zoukankan      html  css  js  c++  java
  • 日常bug整理--xxtz

    2017-12-12

    建SQLite数据库表时,遇到外键关联报错:foreign key mismatch

    解决:发现是个粗心问题,关联的外键没有作为主键,原因是关联的外键由INT改为varchar字符型,取消主键自增的同时把主键也取消了尴尬


    2017-12-12

    mybatis配置SQLite的是时候数据源不正确

    SSM项目启动时报错:the JDBC Driver has been forcibly unregistered.

    参考:

    http://blog.csdn.net/hj7jay/article/details/51686418    数据库阿里连接池 druid配置详解


    2017-12-14

    Mybatis访问sqlite数据库时,查询和插入没有效果,原因:

    ①SSM框架访问的sqlite数据库db文件和sqlite客户端工具sqlite expert professional访问的db文件不是同一个

     

    ②另外sqlite插入语句又主键自增的可设null值再插入数据库,自动会自增

    1 Message msg = new Message();
    2 msg.setMsgno(null);
    <insert id="addMsg" parameterType="Message">
    insert into message(msgno,specno,senddate,notes) values(
    #{msgno},
    #{specno},
    #{senddate},
    #{notes}
    )
    </insert>

    2017-12-14

    报错

    [WARN] Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["content"]->org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.toolObj"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["content"]->org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.toolObj"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])
    2017-12-14 10:27:44,755 [http-bio-8090-exec-2] [org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]-[WARN] Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["content"]->org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.toolObj"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["content"]->org.springframework.validation.support.BindingAwareModelMap["org.springframework.validation.BindingResult.toolObj"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])
    2017-12-14 10:27:44,755 [http-bio-8090-exec-2] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Null ModelAndView returned to DispatcherServlet with name 'springmvc': assuming HandlerAdapter completed request handling
    2017-12-14 10:27:44,755 [http-bio-8090-exec-1] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Null ModelAndView returned to DispatcherServlet with name 'springmvc': assuming HandlerAdapter completed request handling
    2017-12-14 10:27:44,756 [http-bio-8090-exec-2] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Successfully completed request
    2017-12-14 10:27:44,756 [http-bio-8090-exec-1] [org.springframework.web.servlet.DispatcherServlet]-[DEBUG] Successfully completed request
    2017-12-14 10:27:44,757 [http-bio-8090-exec-2] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'sqlSessionFactory'

    解决,把Model换成Map<String,Object>


    2017-12-18

    java插入sqlite时间总是为

    1899-12-30

    解决

    senddate=DateUtil.getDateToString(DateUtil.getStringToDate("s"));
  • 相关阅读:
    Cypress web自动化18-cypress.json文件配置baseUrl
    Linux学习29-awk提取log日志信息,统计日志里面ip访问次数排序
    docker学习14-配置 docker 阿里云/腾讯云加速器
    Cypress web自动化17-fixture加载json文件数据
    Cypress web自动化16-参数化,数据驱动测试案例
    Cypress web自动化15-Hooks使用方法
    Cypress web自动化14-window窗口属性
    Cypress web自动化13-viewport设置不同分辨率,适配不同设备,手机型号
    Cypress web自动化12-父子元素定位
    Eclipse安装scala
  • 原文地址:https://www.cnblogs.com/ccEmma/p/8036069.html
Copyright © 2011-2022 走看看