type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object

今天在进行代码检查的时候出现下面的异常:

1 type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object

当时的第一感觉就是代码因为jdk版本太低引起的、

因为最后咨询了配置管理组的同事,确实发现是因为我本地jdk用的是1.7版本,而代码检查机器上用的是jdk1.6版本。因此出现了这个问题。

其实出现这个问题的解决办法很简单:

1.  升级jdk版本

2.    修改代码

第一种升级jdk版本的方式我们就不细说了,说说第二种,原始代码为:

1     public int queryIpCount(String ipAddr) {
2         return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr);
3     }

修改为:

1     public Integer queryIpCount(String ipAddr) {
2         return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr);
3     }

也就是将返回类型从int修改为Integer就ok了。

 

参考资料:

Error: type parameters of <T>T cannot be determined during Maven Install

时间: 2025-01-30 22:18:11

type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object的相关文章

no suitable HttpMessageConverter found for request type [java.lang.Integer]

今天在使用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

java.lang.IllegalArgumentException: argument type mismatch

问题描述 我建了一个添加新生的表单,属性中有一个时间.我用的是My97DatePicker控件.我的ACTION是以下publicclassAddStudentActionextendsAction{privateManagerDAOmanagerDAO=null;publicAddStudentAction(){this.managerDAO=newManagerDAO();}publicActionForwardexecute(ActionMappingmapping,ActionFormf

android-Value ? of type java.lang.String cannot be

问题描述 Value ? of type java.lang.String cannot be public class Register_ extends Activity{ private ProgressDialog pDialog; JSONParser jsonParser = new JSONParser(); EditText name; EditText password; Button login_button; private static String url = "htt

java.lang.UnsatisfiedLinkError: dlopen failed:unknown reloc type 160

In case you set up your environment with another version of NDK than the recommended one (r9d) and got an error on launching the app: 1 java.lang.UnsatisfiedLinkError: dlopen failed: 2         unknown reloc type 160 You can try modifying the~/Project

Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property &#039;xxx&#039;: no matching editors or conversion strategy found

今天在完成项目的时候遇到了下面的异常信息: 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

date java.lang.IllegalArgumentException: argument type mismatch

项目使用 strut2 ,spring,hibernate,提交表单时报错 Java.lang.NoSuchMethodException: com.shop.jn.entity.Goods.setBuyDateTime([Ljava.lang.String;)] 异常详细信息: Xml代码   11:23:30,113  WARN  - Error setting expression 'goods.buyDateTime' with value '[Ljava.lang.String;@10

java.lang.IllegalArgumentException: Cannot convert value of type [com.ssh.dao.im

问题描述 org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'userService'definedinServletContextresource[/WEB-INF/applicationContext.xml]:Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.TypeMismatchExce

Httpclient报错:java.lang.IllegalArgumentException: HTTP parameters may not be null

问题描述 我在Android上使用HttpClient的时候,Execute的时候提示有错误.错误log见下面.请问是什么问题?11-2421:39:22.546:W/System.err(30708):java.lang.IllegalArgumentException:HTTPparametersmaynotbenull11-2421:39:22.547:W/System.err(30708):atorg.apache.http.params.HttpProtocolParams.getUs

spring mvc Failed to convert property value of type java.lang.String to required

问题描述 在使用springmvc的时候,遇到一个非常痛苦的问题:Failedtoconvertpropertyvalueoftypejava.lang.Stringtorequiredtypejava.lang.Integerforpropertyorder;nestedexceptionisjava.lang.NumberFormatException:Forinputstring:"sadfas"errors.requiredgoogle了一大把,也照别人说的做了,添加prote