今天写一个接口的时候报了下面的错误,接口如下:

@RequestMapping(value = "/isSignOuted", method = RequestMethod.GET)
public String isSignOuted(long busId){
}

Optional long parameter 'busId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

这是因为这个参数如果是非必须的话,如果前端没有传参数过来的话,会先将参数赋值为null,但是你如果用基本数据类型long的话,它是接收不了null的,所以它建议你将参数的类型声明为包装类型Long,才可以接收null。

Optional long parameter ‘busId‘ is present but cannot be translated into a null value相关推荐

  1. Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being decl

    错误描述: processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter ...

  2. Optional int parameter 'page' is present but cannot be translated into a null value due to being dec

    这个错误犯两回了 int改integer 原始类型不能为null 包装类可以 我的spring mvc 代码: @Controller @RequestMapping("/product&q ...

  3. Optional int parameter 'id' is present but cannot be translated into a null value due to being

    执行## ........(int id);报出以下错误. Optional int parameter 'id' is present but cannot be translated into a ...

  4. Optional int parameter ‘page‘ is present but cannot be translated into a null value due to being dec

    背景:在测试上面这个controller时(status为查询条件Limit,查询status为1/0的所有记录),当用postman发出请求http://localhost:8080/orders/ ...

  5. Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being.....

    异常代码 `j`ava.lang.IllegalStateException: Optional int parameter 'tyId' is present but cannot be trans ...

  6. Optional int parameter ‘id‘ is present but cannot be translated into a null value

    接收参数时遇到的问题 开始的代码 @RequestMapping("/deleteComment")@ResponseBodypublic ResultInfo deleteCom ...

  7. Optional int parameter ‘xxx‘ is present but cannot be translated into a null value due to being

    Optional int parameter 'domainId' is present but cannot be translated into a null value due to being ...

  8. Optional int parameter ‘grade‘ is present but cannot be translated into a null value due to being de

    完整的错误提示信息: 复制出来看的清楚些: Optional int parameter 'grade' is present but cannot be translated into a null ...

  9. Optional int parameter ‘categoryId‘ is present but cannot be translated into a null value due to be

    Optional int parameter 'categoryId' is present but cannot be translated into a null value due to bei ...

最新文章

  1. 第八章 泛型程序设计
  2. BESR备份还原SERVER 2003域控制器
  3. css你所不知道技巧
  4. Java的面试汇总,有这些还担心不通过?
  5. Java虚拟机运行时数据区
  6. PHP 中数组获取不到元素
  7. BFS和DFS的java实现
  8. 2017-2018-2 20165314 实验三《 敏捷开发与XP实践》实验报告
  9. delphi7连接oracle,delphi7.0连接oracle数据库的.doc
  10. ttc文件linux安装,Linux当中如何安装字体?
  11. Windows解压tar.gzip文件
  12. 关于本地磁盘“介质受写入保护”的解决
  13. python解析库 爬虫_Python-爬虫-解析库(Beautiful Soup)的使用
  14. 操作系统第2章作业题答案
  15. sqlserver数据库18456错误怎么解决?
  16. CS231n系列之 Lecture1:Introduction
  17. 英语论文格式有什么要求?
  18. iOS 【模仿App 获取app素材】
  19. 解释#define的用法
  20. Unity3D使用Animation编辑器编辑动画

热门文章

  1. python语言程序设计实验题_“Python语言程序设计”问卷调查
  2. Setup Factory使用
  3. 注册表中性能计数器说明文字字符串数值的格式不正确
  4. 如何判断LeapYear
  5. 软件工程基础个人项目——数独终局生成求解
  6. 推荐系统的向量检索工具: Annoy Faiss
  7. 判断元素16种方法expected_conditions
  8. 智慧农业大棚控制方案
  9. 导出Excel三种方法
  10. TPM密钥(可迁移 不可迁移)