The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the argumen

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the argumen相关的知识,希望对你有一定的参考价值。

技术分享

引入别人的项目发现利用HibernateTemplate的load的方法报错了。错误提示为:

The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

意思为load方法的第二个参数是实现Serializable接口的对象,int类型不符合。但jdk自动装箱,int会自转换为Integer,而Integer是实现了Serializable的,所以应该是可以的。但myeclipse偏偏报错了,原因是我的myeclipse中window->preferences->java-compiler中的Compiler compliance level设置为1.4。

解决方法是把window->preferences->java-compiler中的Compiler compliance level成1.6

或者强制转换一下。

改成

技术分享

 

以上是关于The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the argumen的主要内容,如果未能解决你的问题,请参考以下文章

(TODO:)下载图片,报错:warning: could not load any Objective-C class information from the dyld shared cache.

EventBusException:Subscriber class and its super classes have no public methods with the @Subscribe

EventBusException:Subscriber class and its super classes have no public methods with the @Subscribe(

PHP 报错:Deprecated: Methods with the same name as their class will not be constructor...

ESPCMS做的网站,报错Deprecated: mysql_pconnect(): 或 Deprecated: Methods with the same name as their class

IntelliJ IDEA 更新到2020 Cannot load a JDK class: com.sun.jdi.Field Please ensure you run the IDE on