CachedRowSetImpl 引用报错 Access restriction

来源:互联网 发布:安卓app源码 编辑:程序博客网 时间:2024/06/05 08:50

调用CachedRowSetImpl类时,出现以下错误:

Access restriction: The type CachedRowSetImpl is not accessible due to restriction on required library C:\glassfish3\jdk7\jre\lib\rt.jar

问题原因:

1.没有rt.jar包,不过这种情况出现的可能性比较小

2.eclipse的设置问题(一般都是这个原因)

问题解决:

(1) 一般方法:要在project build path中先移除JRE System Library,再添加库JRE System Library,之后就可以了。

(2) 暴力方法:它默认把这些受访问限制的API设成了ERROR,我们只要把
Windows->Preferences->Java->Complicer->Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过了

0 0