使用esapi报错解决方法
来源:互联网 发布:seo设置是什么意思 编辑:程序博客网 时间:2024/05/22 12:23
使用esapi时报错:
Not found in 'org.owasp.esapi.resources' directory or file not readable: C:\Users\ccg\Desktop\esapi\ESAPI.properties
Not found in SystemResource Directory/resourceDirectory: .esapi\ESAPI.properties
Not found in 'user.home' (C:\Users\ccg) directory: C:\Users\ccg\esapi\ESAPI.properties
Loading ESAPI.properties via file I/O failed. Exception was: java.io.FileNotFoundException
Exception in thread "main" org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException SecurityConfiguration class (org.owasp.esapi.reference.DefaultSecurityConfiguration) CTOR threw exception.
Attempting to load ESAPI.properties via the classpath.
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:129)
ESAPI.properties could not be loaded by any means. Fail. Exception was: java.lang.IllegalArgumentException: Failed to load ESAPI.properties as a classloader resource.
解决方法:将esapi.jar添加到项目之后,还要引入ESAPI.properties和validation.properties两个文件。
如何引入这两个文件,第一种方法:建立一个Resources类型的文件夹,把这两个文件直接甩里面即可。
第二种方法:在myeclipse中,选中某个项目,然后在工具栏中选择"Run-->Run Confgurations“,然后在对话框的右边选择"Arguments,然后在VM arguments中输入
if(customDirectory != null && f.canRead()) { this.logSpecial("Found in \'org.owasp.esapi.resources\' directory: " + f.getAbsolutePath()); return f;} else { this.logSpecial("Not found in \'org.owasp.esapi.resources\' directory or file not readable: " + f.getAbsolutePath()); 其中有:
private static String customDirectory = System.getProperty("org.owasp.esapi.resources");查资料得:我的理解是这样的,在myeclipse中,选中某个项目,然后在工具栏中选择"Run-->Run Confgurations“,然后在对话框的右边选择"Arguments,然后在VM arguments中输入-Dproperty.name=value,这样,在你的代码中使用System.getProperty(property.name)即可以获取value的值。
希望可以帮助到你们。
- 使用esapi报错解决方法
- DropDownList使用报错解决方法
- nc6报错 Failed to load ESAPI.properties as a classloader resource.
- nc6报错 Failed to load ESAPI.properties as a classloader resource.
- nc6报错 Failed to load ESAPI.properties as a classloader resource.
- BoundChecker使用报错的解决方法
- 使用 Statspack报错的解决方法
- 使用Guava报错NoSuchMethodError的解决方法
- 使用Guava报错NoSuchMethodError的解决方法
- Python使用wxPython报错解决方法
- Qt使用opengl报错 解决方法
- git使用总结报错解决方法
- vue使用stylus报错解决方法
- VS上使用OpenCV报错解决方法
- 从JavaWeb危险字符过滤浅谈ESAPI使用
- ESAPI——预防XSS攻击工具使用简介
- linux报错解决方法
- 报错信息 解决方法
- JVM内存模型与内存分配
- 善用设计模式(一)单例模式
- 清理Xcode文件,找回 Macbook 的 SSD 硬盘空间
- C++第四次作业(利用循环求和,求和,富翁穷人)
- GBrowse2.0中将GFF3数据转存到MySQL中
- 使用esapi报错解决方法
- SpannableString实现TextView多文字颜色显示
- B1001.害死人不偿命的(3n+1)猜想
- Qt程序打包发布方法(使用官方提供的windeployqt工具)
- git 的 安装和使用
- ES6新特性简介
- Ubuntu Eclipse经常挂掉问题
- 封装的截取高清图的demo~
- 传统盒模型和css3盒模型对比