JAVA工程中已生成代理类(如何在MyEclipse环境下生成代理类可参考文章“对c# / Java + Web Service架构方式进行的可行性测试”)

(1)项目在编译时报错:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commous/httpclient/methods/RequestEntity

则需要下载Apachehttpclient开发包,然后将commons-httpclient-3.1-rc1.jar添加到工程中。

下载地址 - http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi

发行注记 - http://www.apache.org/dist/jakarta/commons/httpclient/RELEASE-NOTES.txt

(2)生成的代理类中如果出现以下错误:

Syntax error,annotations are only available if source level is 5.0

解决办法:Project->JavaCompiler->Compiler Compliance Level->Select "5.0" or Higher

                 Project->Java Build Path->Libraries->Add Library...->JUnit->Select "JUnit 4.0"->Finish

经过以上设置后可顺利解决问题。

posted on 2007-12-18 20:52  超少  阅读(2644)  评论(0编辑  收藏  举报