access restriction
一、既然存在访问规则,那么修改访问规则即可。打开项目的Build Path Configuration页面,打开报错的JAR包,选中Access rules条目,选择右侧的编辑按钮,添加一个访问规则即可。
二、网上的另外一种解决方案:Window - preference - Java - Compiler - Errors/Warnings界面的Deprecated and restricted API下。把Forbidden reference (access rules): 的规则由默认的Error改为Warning。
如我碰到的是不能访问o.e.j.http.ssl.SslContextFactory, 但是它是继承了jetty-util里的类,而jetty-util的access-rule没有导出这个包,添加:
org/eclipse/jetty/util/ssl/*
后来有看了下,原来的SslContextFactory用的是7.5.1的jetty-http里来的,升级到8.1.16后,它已被弃用,而manifest.xml里的import packages里还是导入的jetty-http-ssl而不是jetty-util-ssl,access rule就是根据这个来的,所以把代码改成使用jetty-util中的类而不是已经弃用的jetty-http中的类,修复import packages就好了.
access restriction的更多相关文章
- 关于Access restriction: The type 'Application' is not API (restriction on required library)
原文链接:http://rxxluowei.iteye.com/blog/671893 今天写第一次写JavaFX的入门程序就GG 遇到了导入API的问题,无奈疯狂地通过网络找解决方案.. 我的问题是 ...
- Access restriction: The type TaskTopicResolver is not accessible due to restrict
Access restriction: The type TaskTopicResolver is not accessible due to restrict : Eclipse 默认把这些受访问 ...
- Access restriction错误解决办法
Access restriction错误, XX方法 is not accessible due to restriction on required library XXlib 解决方案: Ecli ...
- Access restriction: The type 'BASE64Encoder' is not API
问题的原因好像是这个方法不是安全的,所以不推荐使用,我是在做毕设时要用到的所以就直接用了(毕设要求没有那么严格的要求)
- Eclipse 编译错误 Access restriction:The type *** is not accessible due to restriction on... 解决方案
报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...
- Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
解决方法: Project -> Properties -> libraries, 先remove掉JRE System Library,然后再Add Library重新加入. ===== ...
- Eclipse error:Access restriction
报错:Access restriction: The method decodeBuffer(String) from the type CharacterDecoder is not accessi ...
- Access restriction: The type VerticalTextSpinner is not accessible due to restriction on required library........
查了下竟然是编译器报错,orz了. Access restriction: 访问限制 on required library: 在依赖库(第三方包) 那就简单了,取消限制就好, eclipse的Win ...
- Java: How to resolve Access Restriction error
Issue: Access restriction: The constructor 'BASE64Decoder()' is not API (restriction on required lib ...
- Access restriction: The type 'BASE64Encoder'
Access restriction: The type 'BASE64Encoder' is not API (restriction on required library 'D:\Java\jd ...
随机推荐
- redis3--key的操作
我们之前使用Redis简单存储了三个参数:在语句set name jack中,其中name就是一个key.我们Java中的变量名是有一定规则的,比如组成内容可以是"数字",&quo ...
- 解决Eclipse无法添加Tomcat服务器的问题
eclipse配置好以后,如果Tomcat服务器在文件系统的位置发生了变化,则需要重新配置Tomcat服务器,这时会遇到无法设置服务器的问题 即图中框起来的部分无法进行操作,这时需要 关闭Eclips ...
- js函数大全(2)
原文地址:http://phperbar.blog.163.com/blog/static/162596182201032935815391/ 1.常规函数 javascript常规函数包括以下9个函 ...
- ASP.NET 读数据库绑定到 TreeView 递归方式
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs& ...
- win7系统,apache2.2下添加PHP5的配置详解
首先要说apache(服务器). php(开发语言). mysql(数据库) 之间的关系. Apache:为系统提供了Web服务支持,网站:http://www.apache.org/ PHP:为系统 ...
- JavaScript高级程序设计:第五章
引用类型 一.object类型: 创建object实例的方式有两种.第一种是使用new操作符后跟Object构造函数,如下所示: var person = new Object(): person ...
- InjectAPC全部项目(Win32和Win64位)
// InjectAPC.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <Windows.h> #inclu ...
- float的精度,3个小数相加后精度丢失--小数比较使用bccomp()方法
$a = 1200.00;$b = 1199.80;$c = 0.1;$u = 0.12; $d = $b+$c+$u;var_dump($a);var_dump($d);var_dump(bccom ...
- csuoj1009
AC代码: #include <iostream>#include <iomanip>using namespace std;//计算数学期望值,可以自己直接通过数组的方式来实 ...
- 购物车(Shopping cart) —— B2C网站核心产品设计 (二)
购物车是做什么的? 我们先来看一下现实超市中的购物车,一个带四个轱辘的铁筐子,客人推来推去,看到什么东西喜欢,就扔进去,觉得东西差不多了,就推到收银台. 那B2C网站中的购物车又是一个什么东西呢? 从 ...