【问题标题】:JRun Servlet Error when attepting to use java object尝试使用 java 对象时出现 JRun Servlet 错误
【发布时间】:2010-03-10 17:20:45
【问题描述】:

我们在 ColdFusion 中有一个站点,它使用 Java 组件与信用卡提供商集成。

在 java 对象上调用特定函数时:

<cfset ResponseObject = AgentObject.request(RequestObject, LogObject)>

其中 ResponseObject、AgentObject 和 LogObject 是创建的 java 对象,如下所示:

<cftry>

    <cfset AgentObject = createObject("java","com.providername.client.Agent")>

    <cfcatch type="any">
        Do something.
    </cfcatch>
</cftry>

页面输出以下内容并停止执行。

<head>
<title>JRun Servlet Error</title>
</head>
<h1>500 Transaction fails verification<br>
    BadRequest: Request fails verification checks<br>
    BadCardNumber: Card length was 16, but we were expecting 0<br>
</h1>
<body>
Transaction fails verification<br>
BadRequest: Request fails verification checks<br>
BadCardNumber: Card length was 16, but we were expecting 0<br>
</body>

该错误是预期的(我们正在检查卡详细信息),但我似乎无法捕捉到它。 cftrycfcatch 没有任何效果,所以我完全不知道如何处理这个错误并继续执行。

谁能帮忙?

干杯,

汤姆

编辑 - 附加错误信息

我认为发布此堆栈跟踪也可能很有用。它不能通过 Coldfusion 访问,而是作为LogObject 的一部分记录到文件中,大概是在 Java 代码中:

    com.providername.client.errors.VerifyErrorReport: Transaction fails verification
    com.providername.client.errors.BadRequest: Request fails verification checks
        com.providername.client.errors.BadCardNumber: Card length was 16, but we were expecting 0
            at com.providername.util.CardInfo.verifyCardNumber(CardInfo.java:412)
            at com.providername.util.CardInfo.validateCardInfo(CardInfo.java:789)
        at com.providername.util.CardInfo.validateCardInfo(CardInfo.java:838)
        at com.providername.client.Agent.setupTransaction(Agent.java:681)
    at com.providername.client.Agent.setupTransaction(Agent.java:692)
    at com.providername.client.Agent.request(Agent.java:281)
    at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:74)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
    at cfprovidername2ecfc526409752$funcSENDXMLOBJECT.runFunction(D:\site\components\providername.cfc:210)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:290)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:169)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
    at cftransactions2ecfc114461696$funcTRANSACTION.runFunction(D:\site\components\transactions.cfc:175)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:344)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:290)
    at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:254)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:207)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:366)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:198)
    at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:157)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1594)
    at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:341)
    at cfauthorise2dprovidername2ecfm1546743078._factor7(D:\site\payment\authorise-providername.cfm:224)
    at cfauthorise2dprovidername2ecfm1546743078._factor27(D:\site\payment\authorise-providername.cfm:164)
    at cfauthorise2dprovidername2ecfm1546743078._factor30(D:\site\payment\authorise-providername.cfm:91)
    at cfauthorise2dprovidername2ecfm1546743078.runPage(D:\site\payment\authorise-providername.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
    at cfauthorise2ecfm767248619.runPage(D:\site\payment\authorise.cfm:10)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
    at cftemplate2ecfm1091873885._factor4(D:\site\server\template.cfm:247)
    at cftemplate2ecfm1091873885.runPage(D:\site\server\template.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
    at cfapplication2ecfm1526755454._factor31(D:\site\application.cfm:673)
    at cfapplication2ecfm1526755454.runPage(D:\site\application.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915)
    at cfApplication2ecfm1608241748.runPage(D:\site\payment\Application.cfm:30)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:172)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    at coldfusion.CfmServlet.service(CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

【问题讨论】:

  • 似乎与您的 RequestObject 无法验证数据有关
  • 您能否向我们展示更多您的代码 - 这样我们就可以看到 try/catch 调用。
  • @CF Jedi Master 我已经添加了 try catch 代码。它就像我能得到的一样简单,没有任何区别。
  • @mplacona 我同意 RequestObject 由于这个验证错误而导致错误,但我当然应该能够以某种方式捕捉到这一点,而不会出现 JRun 错误。
  • 也许“Any”不起作用,你需要java异常类吗? petefreitag.com/item/699.cfm

标签: servlets coldfusion jrun


【解决方案1】:

我在这方面有点晚了,但你得到的不是 JRun 错误本身。似乎在 JRE 中引发了错误,而 JRun 将其显示为“Servlet 错误”。注意堆栈跟踪中的行:

com.providername.client.errors.VerifyErrorReport: Transaction fails verification
com.providername.client.errors.BadRequest: Request fails verification checks
    com.providername.client.errors.BadCardNumber: Card length was 16, but we were expecting 0
        at com.providername.util.CardInfo.verifyCardNumber(CardInfo.java:412)

这看起来像是第 412 行的 verifyCardNumber() 中的 CardInfo 类引发的错误。我认为 JRun 只是将错误作为“Servlet 错误”提供,因为在 com.providername.client.errors.VerifyErrorReport 中有一个硬停止。

这也可能是您的&lt;cfcatch&gt; 无法捕获该异常的原因。 Java 类可能会捕获该错误并在 Java 中抛出该异常,这会导致丑陋的 JRun 500 错误。

如果您没有 Java 源来检查为什么在 CardInfo 中出现该异常,那么您应该联系拥有该源的人,看看他们是否有任何见解。

我希望这对你有所帮助。

【讨论】:

  • 嗨,Joe,感谢您的回答 - 代码归信用卡处理器所有,他不会发布源代码或提供有关错误的任何进一步信息。在没有任何进一步信息的情况下,我会将您的答案标记为已接受的答案!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-02-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多