controller层返回值类型为Integer,然而报 Unknown return value type: java.lang.Integer 这个错误,500错误 解决办法:在此方法上写上注解@ResponseBody…
controller层返回值类型为Integer,运行报错: Unknown return value type: java.lang.Integer 解决办法:在此方法上写上注解 @ResponseBody . @responseBody注解的使用 1. @responseBody注解的作用是将controller的方法返回的对象通过适当的转换器转换为指定的格式之后,写入到response对象的body区,通常用来返回JSON数据或者是XML 数据,需要注意的呢,在使用此注解之后不会再走试图处…
添加@responsebody 为什么呢 ? 因为在进行ajax传输的时候  我已指定传输的类型为 json数据类型 要是不加的话 它只是Boolean类型 而不是json类型…
题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后更快的解决此类问题. BUG的报错信息如下所示: org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integ…
今天在使用Spring Template的时候遇到了这个异常: no suitable HttpMessageConverter found for request type [java.lang.Integer] Google了一下然后在stackoverflow上面找到了解决方案: I have a method in Spring rest service. @RequestMapping(value = "test/process", method = RequestMetho…
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.Pattern' validating type 'java.lang.Integer'. Check configuration for 'sortType' at org.hibernate.validator.internal.engine.c…
使用hibernate时,在save方法时,报了:org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer,因为@NotBlank是针对String的   . 解决方法是将实体类的注解换成     @NotNull,就行了, 替换前 替换后…
转自:https://blog.csdn.net/zengdeqing2012/article/details/50978682 1 [WARN ] 2016-03-25 13:03:23,955 - org.springframework.remoting.support.RemoteInvocationTraceInterceptor -53288 [RMI TCP Connection(5)-192.168.1.140] - Processing of RmiServiceExporter…
情景: mybatis连接oracle 报错: 测试增的时候,报错 Java.lang.Long cannot be cast to  java.lang.Integer:删改没有报错. 排查过程: 1.先针对映射的sql进行排查,打印sql,直接在oracle上执行,没有问题. 2.观察接口的返回结果,发现返回值定义为int,找到问题所在. 问题虽小,但发现问题的时间稍长.从另一个方面说明,代码生成很有必要.…
问题原因所在:前端Vue传输的数据字段类型和后端实体类字段不一致. 我的实体类字段是int类型.前端传输的数据是布尔类型. 文章目录 1.后端方法 2.实体类字段 2.前端传输的数据 1.后端方法 @RequestMapping(value = "/car/editCar", method = RequestMethod.PUT) public Result updateOneUser(@RequestBody Car car) { int rs = carService.update…
GET方式,参数必须放在URL后面,http://xxx/list?name={name}&age={age} package com.chelizi.xiruo.xframework.util; import net.sf.json.JSONObject; import org.springframework.http.*; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.spr…
在写接口时,一般去查找在类的Integer属性上加了不属于整型的校验,比如@NotEmpty,@Length等 @JSONField(name = "deviceNum") @NotNull(message = "设备数量必填") @Length(max = 200, message = "请不要填写超过200个字符") private Integer deviceNum; 去掉@Length(max = 200, message = "…
在将MySql的数据对应到Java的实体类的时候, 遇到了错误 关键点: Hibernate从mysql数据库查出来的Timestamp类型的数据, 会被Hibernate(或者是数据库连接池Druid)自动转换为了Integer数据类型 所以就应该把Entity实体类中的Timestamp的数据类型修改为Integer类型, 然后问题就得到了解决 结果如下: 能正常运行了 ---------划重点------------------ 后来又发现这个问题原来真正的原因在这里!!!! 在这个文件的…
Jpa自定义查询报错 问题背景 今天遇到一个奇怪的报错"Failed to convert from type [java.lang.Object[]] to type",这个报错,百度上也是很少的,恰恰是这样的问题,引起我了解决的欲望.先看看报错: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.Object[]] to type [o…
用MyBatis进行查询,传入参数只有一个时(非Map)如int,报错 There is no getter for property named 'sleevetype' in 'class java.lang.Integer 解决方法一: 原因在于测试条件写法有误, <if test="sleevetype==0"><!-- 专属 --> exclusive=1 </if> <if test="sleevetype!=0"…
问题:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 大概意思就是.class文件引用错误, 联想一下 编译出了问题, JRE问题.…
springMVC action接收参数: org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errorsField error in object 'projectStep' on field 'createDate': rejected value [2016-6-23]; codes [typeMismatch.projectSt…
没有选择附件,但是点击上传按钮的时候会报错. 之前不选择文件,直接上传空文件是可以的,后来不知道改了什么就不行了. 错误信息: -- :: [http--] TRACE org.springframework.beans.TypeConverterDelegate - Field [] isn't an enum value java.lang.NoSuchFieldException: at java.lang.Class.getField(Unknown Source) at org.spr…
今天做springbook项目前端输入日期传到数据库保存报了一下错误 Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Sun Feb 09 16:31:32 CST 2020 There was an unexpected error (type=Bad Request, status=400). Validation…
javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193) javax.el.BeanELResolver.property(BeanELResolver.java:267) javax.el.BeanELResolver.getValue(Bean…
今天在完成项目的时候遇到了下面的异常信息: 04-Aug-2014 15:49:27.894 SEVERE [http-apr-8080-exec-5] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [cms] in context with path [/cms] threw exception [Request processing failed; nested excep…
在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for property 'expert.birthdate'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of typ…
七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:EBook' did not find a matching property.七月 11, 2016 3:4…
最近在做J2ME开发项目,配置环境一切OK,但是打开项目时某些文件提示: The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files,经查阅是因为环境中的JRE冲突引起的,我是通过以下方式解决了问题. 在Eclipse上依次打开Windows->Preferences->Java->Build Path->User Libraries,清空列…
基本情况: (这些其实关系不大)我是直接impor导入HibernateDemo项目到eclipse中的,该项目的hibernate版本是3.6.7.Final版,使用了Hibernate Tools插件(我的是在线安装的最新版),MySql驱动按照步骤正常部署进去,不过由于jdbc的版本不同,我给把原来lib文件夹的jar包删了用了自己的.出现问题:The type java.lang.Object cannot be resolved. It is indirectly referenced…
参考:http://blog.csdn.net/wo519074786/article/details/7697967 The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 当你在Eclipse引用不同版本JDK工程时会发生该问题.由于你开发环境中应用了多个版本的JDK 或JRE导致的.Eclipse会按照最初的开发环境默认选择对应的Jre.如Ecl…
Struts2.16与Spring4.x整合出错: Caused by: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name…
The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class files 当你在Eclipse引用不同版本JDK工程时会发生该问题.由于你开发环境中应用了多个版本的JDK 或JRE导致的.Eclipse会按照最初的开发环境默认选择对应的Jre.如Eclipse上有jdk1.4开发的环境工程,当你在引入高版本jdk1.6开发的工程时,以上问题就出现了. 问题解决的方案如下:…
一.问题描述 1)项目一开始采用JAX-RS 2.1+Jersey 2.26调用REST服务能正常调用并获得正确响应: 2)当项目引入dubbo 2.6.2后也用到rest而dubbo要用到RESTEasy,项目就引入了RESTEasy: 3)项目引入RESTEasy后,JAX-RS 2.1+Jersey 2.26调用REST服务出现异常!异常信息如下: javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke reque…
详细错误信息 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and paramete…