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

引入别人的项目发现利用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 arguments (Class, int)的更多相关文章
- The method format(String, Object[]) in the type String is not applicable for the arguments
今天,我弟遇到一个有意思的错误~ 程序: package com.mq.ceshi1; public class StringFormat { public static void main(Stri ...
- The method setClass(Context, Class<?>) in the type Intent is not applicable for the arguments (GameV
在当前短信内容的activity中写 Bundle bun = new Bundle(); bun.putString("message", ...
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable
开始学习 android 了,学习的是高明鑫老师的android视频教程(android视频教学). 学到第八讲时, 在写动态设置时报错: The method setOnClickListener( ...
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)
Fragment newfragment =new MyFragment();fragmentTransaction.replace(R.layout.activity_main,newfragmen ...
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)
The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the ...
- The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)
package comxunfang.button; import android.support.v7.app.ActionBarActivity; import android.os.Bundle ...
- The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object)
1. 问题 看到这个错误以为是貌似jsp页面有误,c:forTokens标签用错了?? An error occurred at line: in the jsp file: /WEB-INF/pag ...
- [log4j]Error:The method getLogger(String) in the type Logger is not applicable for the arguments
原因:本该导入import org.apache.log4j.Logger; 结果成了import java.util.logging.Logger; 如果硬把private static Logge ...
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments
The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i ...
随机推荐
- JAVA与图形界面开发(Applet应用程序、AWT库、Swing)
Applet 1)简单说,Applet就是嵌入到网页中的小程序,Java代码. 2)编写Applet程序,要继承JApplet类,并根据自己需要覆写相关方法(init.start.stop.destr ...
- sublime text 2使用经验
1. Package Control 安装代码: import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.instal ...
- JAVA虚拟机之类加载器
转载请声明:原文转自http://www.cnblogs.com/xiezie/p/5909570.html 1.JVM的生命周期 1.1 JVM的生命周期和程序的生命周期一致 1.2 JVM结束生命 ...
- 修改 jquery easyui 表单验证默认的样式
目前对于不符合要求的输入域会在右侧显示一个带箭头的提示,可是如果我的输入框比较靠右的话就显示不全了(虽然会出滚动条,但是由于鼠标移开就消失了,所以还是看不到提示内容)! 能不能把这个提示的位置改变一下 ...
- JavaFx2.0中CSS的应用
http://user.qzone.qq.com/773534839#!app=2&via=QZ.HashRefresh&pos=1326994508 ———————————————— ...
- ocp 1Z0-042 1-60题解析
1. Because of a power outage,instance failure has occurred. From what point in the redo log does rec ...
- How to include JavaScript file in JSF
In JSF 2.0, you can use <h:outputScript /> tag to render a HTML "script" element, an ...
- RHEL安装配置JAVA
查看当前java版本 [root@esb-mmplus-04 ~]# java -version java version "1.6.0_24" OpenJDK Runtime E ...
- 51单片机或PLC驱动3.5寸至52寸的数字TFTLCD屏、VGA接口显示器、电视机
http://www.21easyic.com/yx/VGA%E6%8E%A7%E5%88%B6%E6%9D%BF.htm
- Unity3D之Mecanim动画系统学习笔记(八):Animator Layers(动画分层)
解决什么问题? 动画分层可以用来解决什么样的问题呢?试想一下如果你要开发一款第三人称的射击游戏,那么肯定是希望身体的动画分为上下两部分,上方根据瞄准的位置和是否射击进行动画播放,下方根据移动播放动画. ...