测试例子:
public class DaoAgent extends BaseDaoAgent{
public DaoAgent(){
this.initialize(TestDAO.class);
}
public static void main(String[] args){
DaoAgent agent=new DaoAgent();
}
initialize是通过Reflect获得指定类所需方法存储到Hashtable
实现如下
protected void initialize(Class clazz) {
try {
if (ComDAO.class.isAssignableFrom(clazz)) {
Object instance = ReflectUtils.objectInstance(clazz);
Method[] methods = instance.getClass().getMethods();
for (int i = 0; i < methods.length; i++) {
if(ComOutput.class.isAssignableFrom(methods[i].getReturnType())){
daoMapping.put(methods[i].getName(), instance);
}
}
} else {
throw new SystemException("初始化异常,类{0}必须继承于ComDAO!",new String[]{clazz.getName()});
}
} catch (Exception e) {
throw new SystemException("初始化异常",e);
}
}
TestDAO类
public class TestDAO extends ComDAO {
...
public ComOutput getShowNum() throws Exception{
....
}
...
以上代码在Eclipse写的工具类,测试没问题,但在Jbuilder2006用该工具类测试有以下怪现状:
1)在Jbuilder开发环境测试出现java.lang.VerifyError
//Exception in thread "main" java.lang.VerifyError: (class: example/TestDAO, method: getShowNum signature: ()Lcom//util/ComOutput;) Incompatible object argument for function call
2)当getShowNum()方法直接return null;测试通过
2)自己在Eclipse测试的时候完全没问题
3)JDK版本也一致
郁闷,这个问题折腾了我一下午...
分享到:
- 2006-09-21 21:12
- 浏览 11543
- 评论(3)
- 论坛回复 / 浏览 (3 / 8088)
- 查看更多
相关推荐
java.lang.Error 错误。是所有错误的基类,用于标识严重的程序运行问题。这些问题通常描述一些不应被应用程序捕获的反常情况。 java.lang.ExceptionInInitializerError 初始化程序错误。当执行一个类的静态初始化...
39.java.lang.VerifyError 验证错误。当验证器检测到某个类文件中存在内部不兼容或者安全问题时抛出该错误。 40.java.lang.VirtualMachineError 虚拟机错误。用于指示虚拟机被破坏或者继续执行操作所需的资源不足的...
IKAnalyzer是一款中文分析器,应用于Solr搜索服务当中。
解决Exception in thread "main" java.lang.VerifyError: class org.wltea.analyzer.lucene.IKAnalyzer overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/...
org.bouncycastle.openssl.PEMException: problem parsing ENCRYPTED PRIVATE KEY: java.lang.SecurityException: JCE cannot authenticate the provider BC at org.bouncycastle.openssl.PEMReader$...
public boolean verify(String hostname, javax.net.ssl.SSLSession session) { return true; } }; // Install the all-trusting host verifier HttpsURLConnection.setDefaultHostnameVerifier...
密码验证,密码在人类的日常生活中是及其重要的,它可以保护人类的隐私,私人财产不受侵害
stm32 下载器的设置资料,可以帮助轻松的设置好 仿真器 文中步骤详细,清楚,有益于新手下载器上手,
(java.lang.Exception e) { System.out.println("生成密钥对失败"); e.printStackTrace(); } } public byte[] getPriKey() { return priKey; } public byte[] getPubKey() { return pubKey; } } ...
Verify burning flash... Failed to get CMD response! Failed to get CMD response! Failed to get CMD response! Failed to get CMD response! Failed to get CMD response! Failed to get CMD response! Failed ...
The main goal of this project is to design and simulate a wireless communication system base on ...numerical result such as bit error rate plots and verify the functionality of each block in the design.
Original error: Cannot verify the signature of 'C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.21.1.apk'....
OPT一次性动态口令验证算法。根据动态支持TOTP和HOTP验证。
You are new to our forum or modify your registration Email address to use this We need to verify the validity of your email address to avoid spam or other abuse actions.To activate your email account ...
verify公共函数(陈攀).js。verify公共函数(陈攀).js。verify公共函数(陈攀).js。verify公共函数(陈攀).js。
A "Hello world" program is a computer program that outputs "Hello, world" on a display device. Because it is typically one ... It is also used to verify that a language or system is operating correctly.
Java的世界里,HttpClient 是一个功能强大的Http请求库,然而接口非常复杂,设计上遵从正交性,简单的请求也需要写比较多的代码,更不要说隐藏在各种细节里面的高级用法了。Requests, 是一个模仿python requests ...
Needed to verify my account because of this stupid site's policy so have a random SXL mod nonces
consequently it is a sensible idea to verify that your java layer is behaving as expected before you try starting up the utility as TFMADMIN, try this exec pack_trace_file_manager.pc_generate_file_...
verify_diskette - to verify that the floppy in the drive is the right one for suninstall. All error messages and prompts go to stderr.