部署 antiSamy 后出现 ParserException 错误
我在 ColdFusion 项目中使用 antiSami
。我通过 onApplicationStart() 加载 antiSami,如下所示:
local.jarsArray =
[
expandPath("lib/antisami/antisamy-1.4.4.jar")
];
application.antiSamiPolicyPath = expandPath("lib/antisami/antisamy-slashdot-1.4.4.xml");
application.javaLoader = createObject("lib.javaloader.JavaLoader").init(local.jarsArray);
application.antiSami = application.javaLoader.create("org.owasp.validator.html.AntiSamy").init();
如果转储 application.antiSami
,我可以看到 antiSami 对象。但是,一旦添加以下行:
local.result = application.antiSami.scan("some text", application.antiSamiPolicyPath);
我收到此通用浏览器 500 消息:
服务器错误, HTTP 错误 500(内部服务器错误):服务器尝试满足请求时遇到意外情况。
在幕后,我通过 CFBuilder 发现了此错误:
"Error","web-4","06/14/11","15:27:04","80BBF6B60584F6D148A7DC2A12007C03","org/apache/batik/css/parser/ParseException 文件的具体顺序包含或处理的是:C:\ColdFusion9\wwwroot\gamers\index.cfm,行: 25 "
你知道这个错误是怎么回事吗?
I'm using antiSami
with my ColdFusion project. I'm loading antiSami through onApplicationStart() like this:
local.jarsArray =
[
expandPath("lib/antisami/antisamy-1.4.4.jar")
];
application.antiSamiPolicyPath = expandPath("lib/antisami/antisamy-slashdot-1.4.4.xml");
application.javaLoader = createObject("lib.javaloader.JavaLoader").init(local.jarsArray);
application.antiSami = application.javaLoader.create("org.owasp.validator.html.AntiSamy").init();
I can see the antiSami object if I dump application.antiSami
. However, once I add the following line:
local.result = application.antiSami.scan("some text", application.antiSamiPolicyPath);
I get this generic browser 500 message:
Server Error, HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
Under the hood, I found this error through CFBuilder:
"Error","web-4","06/14/11","15:27:04","80BBF6B60584F6D148A7DC2A12007C03","org/apache/batik/css/parser/ParseException The specific sequence of files included or processed is: C:\ColdFusion9\wwwroot\gamers\index.cfm, line: 25 "
Any ideas what this error is all about?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,使用 AntiSamy 需要一定数量的依赖项:
batik-css.jar
、batik-util.jar
、nekohtml.jar
和xerceslmpl.jar
。一旦这些被加载,antiSamy 应该可以正常工作,而且确实如此。It turns out using AntiSamy requires a certain number of dependencies:
batik-css.jar
,batik-util.jar
,nekohtml.jar
, andxerceslmpl.jar
. Once those are loaded, antiSamy should work fine, and it does.