【问题标题】:ParserException Error after deploying antiSamy部署 antiSamy 后出现 ParserException 错误
【发布时间】:2011-06-14 17:58:32
【问题描述】:

我在我的 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 消息:

Server Error, HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

在后台,我通过 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 "

你知道这个错误是怎么回事吗?

【问题讨论】:

  • gamer/index.cfm 的第 25 行实际上是什么?
  • @Stephen Moretti,什么都没有。这是我框架中的视图模板。我想我可能已经弄清楚了:AntiSamy 还有其他需要加载的依赖项。我遵循的指南blog.pengoworks.com/index.cfm/2008/1/3/… - 没有提到这一点......但是还有其他三个需要加载的罐子。我即将对此进行测试。
  • @Stephen Moretti,这是依赖关系。加载依赖项后,一切都按预期工作。

标签: java coldfusion antisamy javaloader


【解决方案1】:

事实证明,使用 AntiSamy 需要一定数量的依赖项:batik-css.jarbatik-util.jarnekohtml.jarxerceslmpl.jar。加载这些内容后,antiSamy 应该可以正常工作,而且确实可以。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-19
    • 2020-02-10
    • 2017-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多