严重: Servlet.service() for servlet [note-portal] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Optional long parameter 'noteBookId' is present but cannot be translated into a n…
解决办法:把基本类型改为对象,譬如此处将pageId的类型由int 改为Integer 2016-10-19 19:36:11.275 DEBUG [http-nio-9999-exec-2][org.springframework.web.servlet.DispatcherServlet] Last-Modified value for [/user/1/detail] is: -1 2016-10-19 19:36:11.278 DEBUG [http-nio-9999-exec-2][o…
我的spring mvc 代码: @Controller @RequestMapping("/product") public class Fancy { @RequestMapping(value = "/fancy") @ResponseBody public String showFancy(@RequestParam(value = "page", required = false) int page) { return "{\…
接口测试的时候遇到了一个问题,导致测试阻断了好久,在此记录,谨防忘记. 具体报错如下: Optional int parameter 'pId' 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. 接口…
错误的意思是: "可选的int参数'fundID'存在但由于被声明为基本类型而无法转换为空值" 意思是fundID被申明为int的基本数据类型, 不能转换为字符串的null值. 难道是在参数调用 的时候, 需要把fundID设置为对象类型吗? 答案是正确的. @RequestMapping(value = "/fund-purchase") public String fundPurchase(int fundID) { Fund fund = fundServic…
今天在操作redis的时候报了这个错:Optional int parameter 'time' is present but cannot be translated into a null value due to being decla 这句话意思:参数time存在,但是无法将其转为为null 查看了下原因,time这个字段是用来记录设置多久时间过期的, 我在service层设置的是Long 类型, 我在Controller 层设置的是long类型,前后设置的不一样,猜测前后需要设置一致,…
原文地址:http://blog.csdn.net/kevinzhangfei/article/details/6995316 在action请求数据的过程中报出"Null value was assigned to a property of primitive type setter of"错误,搜索之后发现是因为数据库里相应的字段为NULL. 例如: <!--Hibernate映射文件中的字段--> <property name="printTime&…
异常描述:执行以下的addAsHaveParentId2方法出现此异常: /*-----------------------类Dept.Dept.hbm.xml有parentId属性(数据库中有此列)----------------------*/ @Test//添加一级部门--success(parentId为Null) public void addAsHaveParentId1(){ Dept d = new Dept("市场部", "湖北襄阳"); dept…
[引用http://m.blog.csdn.net/blog/u013998070/41087351] Null value was assigned to a property of primitive type setter of cn.itcast.oa.domain.Forum.topicCount 2014-11-13阅读376 评论0 最近做一个OA项目,其中有一个论坛管理的版块,起初在实体类Forum只有几个字段,在数据库中也有对应的数据,在页面显示时,完全没有任何问题:但是后来在…
由于数据不合法的原因,好几次遇到: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.xugao.bean.MemberLevel.memberpointrate 的异常,很有必要把它记录下来,以免忘记, 当遇到异常的时候一般都是 表中字段有空的情况, 例如:Membenlevel 表, memberpointrate这个字段的值…
在action请求数据的过程中报出"Null value was assigned to a property of primitive type setter of"错误,搜索之后发现是因为数据库里相应的字段为NULL. 例如: <!--Hibernate映射文件中的字段--> <property name="printTime" type="long"><column name="print_time&…
org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.wa.dataprocess.query.model.AcrossDeptApply 包装类和基本数据类型的区别, 包装类默认为null,基本类型为0. public class AcrossDeptApply implements Serializable private Str…
org.springframework.orm.jpa.JpaSystemException: Null value was assigned to a property of primitive type setter of com.eshore.ismp.order.entity.HandSiOrder.siSize; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a…
日志: [WARN-2016/07/26/18/:45/:52]ProcessEngineServiceImpl.(257) - 审批流程log日志--submitProcess方法:提交人userId:3333333349,TaskId:245959,ProcInstId:null,WfInstaceId:16583386853,当前时间:Tue Jul 26 18:45:52 CST 2016 [ERROR-2016/07/26/18/:45/:52]ProjectRepayControll…
出现Null value was assigned to a property of primitive type setter of错误是由于类型不匹配,将字段的属性由hibernate的int类型改为java.lang.Integer类型就可以了, org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside setter of com.eshore.item.model.Chec…
六月 29, 2019 5:42:45 下午 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\OM_HOME\native\WIN32;D:\OM_…
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:109) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:586) at org.hibernate.tuple.entity.PojoEntityTuplizer.s…
错误原因:totalTime的类型为int,数据库中为NULL,int 类型不能赋值为NULL,只能为0,所以报此异常. 解决方案:将totalTime的类型改为Integer,或者初始化为0…
在SSH项目的开发中遇到了下面的错误: 检查后发现数据库和映射文件中这个字段是允许为空的,为什么还要出错呢?原来是因为这个字段是int的,int是基本类型,即使设置成可以为空也不能取空值. 解决的办法就是给这个字段赋一个默认值.…
问题: 解决方法:依据提示,把 int 修改为Integer解决. 总结: javaBean最好不要使用基本类型(记得某规范说过,具体不记得了,估计就是预防这样的问题吧)…
错误日志: java.lang.IllegalStateException: Optional int parameter 'resourceState' 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 typ…
The reason for the error is a new listener in Tomcat 6.0.24. You can fix this error by adding this line: org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false to the "conf/catalina.properties" file in your tomcat directory.…
今天做项目测试接口,查询数据时出现以下错误,记录一下. 查询语句和错误信息: 实体类属性 原因是 由于字段 total和receive 在实体类中使用的是 int类型,但是数据库中查询出来的数据为null ,赋值的时候是不能把null 赋值给Java 基础类型的. 这里就有一个Java 的基础知识点:Java 基础类型不能为null. 解决办法:把实体映射的类型改为包装类型就OK.大家在建实体类model时一定要注意啊!!!…
问题描述: 好久不写博客了,今天遇到一个问题,那就是post请求时,参数接收不到,当时我很纳闷,看代码: 就是这样几个参数,我使用postman请求时无法获取参数: 报错信息: "msg":"Optional int parameter 'tableId' is present but cannot be translated into a null value due to 后来上网查了相关资料: 接口测试的时候遇到了一个问题,导致测试阻断了好久,在此记录,谨防忘记. 具体…
SpringMvc 中@RequestParam注解使用 建议使用包装类型来代替基本数据类型 public String form2(@RequestParam(name="age") int age){ public String form2(@RequestParam(name="age") Integer age) { 上述两种方式 这种情况下使用起来基本没有差别,但是为什么要说建议使用包装类型而不是基本类型呢? 一.@RequestParam属性作用 因为当…
1.分析器错误消息: 无法识别的属性“targetFramework”.请注意属性名称区分大小写 解决方法: 修改.NET Framework 版本为相应版本即可,我以前用的是2.0换成4.0的时候出现这个错误. 我的win7系统, 1.打开IIs点击IIS根节点 2.看右边的“操作”->点击“更改.NET Framework 版本” 3.选择相应的版本,我这里应该选择v4.0.30319,点击确定 4.点击IIS的应用程序池 5.在右边“操作”栏里选择“应用程序默认设置...” 6.把“.NE…
RequestParam注解的Url参数被省略时该如何处理 1.RequestParam的用法 ==================== RequestParam注解可以把包含在Url中的参数映射到Url处理方法的方法参数.比如,Url是http://domain:port/index?action=xxx&notIncludeTypeId=xxx,这个Url中包含了两个参数,如果要在处理这个Url的方法中取得这两个参数,那么就要在Url的响应方法的方法参数前面用RequestParam来映射U…
java.lang.IllegalStateException异常解决方法 这个异常大多数是由文件读取,下载时抛出,但是偶尔也会由类型转换时异常抛出此异常. 错误:Optional int parameter 'primaryKeyId' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object w…
今天有人遇到接口调用不通的情况,粗略看了一下是axios跨域请求引起了.找到问题,处理就简单多了. 但是我看其代码,发现比较有意思 export function agentlist(query) { return request({ url: /agent/list', method: 'get', params: query }) } export function editagent(data) { return request({ url: '/agent/editagent', met…