type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object
2014-06-20 15:27
1216 查看
今天在进行代码检查的时候出现下面的异常:
当时的第一感觉就是代码因为jdk版本太低引起的、
因为最后咨询了配置管理组的同事,确实发现是因为我本地jdk用的是1.7版本,而代码检查机器上用的是jdk1.6版本。因此出现了这个问题。
其实出现这个问题的解决办法很简单:
1. 升级jdk版本
2. 修改代码
第一种升级jdk版本的方式我们就不细说了,说说第二种,原始代码为:
修改为:
也就是将返回类型从int修改为Integer就ok了。
参考资料:
Error: type parameters of <T>T cannot be determined during Maven Install
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版本的方式我们就不细说了,说说第二种,原始代码为:
public int queryIpCount(String ipAddr) { return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr); }
修改为:
public Integer queryIpCount(String ipAddr) { return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr); }
也就是将返回类型从int修改为Integer就ok了。
参考资料:
Error: type parameters of <T>T cannot be determined during Maven Install
相关文章推荐
- Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...
- <java>No enclosing instance of type GraphicFrame is accessible. Must qualify the allocation with an
- java.lang.RuntimeException: Value <pre>bool(false) of type java.lang.String cannot be converted to J
- Value of type java.lang.String cannot be converted to JSONObject 异常
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- <java>No enclosing instance of type GraphicFrame is accessible. Must qualify the allocation with an
- Value of type java.lang.String cannot be converted to JSONObject
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- new JSONObject(str)无法解析 报错:org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject: [Caugh
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject:
- Value of type java.lang.String cannot be converted to JSONObject
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- alue of type java.lang.String cannot be converted to JSONObject
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- of type java.lang.String cannot be converted to JSONObject: Android
- Android The type java.lang.Object cannot be resolved It is indirectly referenced ...
- The type java.lang.Object cannot be resolved.It is indirectly referenced from required.class files