我在VS2008中内置了一个.Net DLL,它将信息从ColdFusion传输到外部系统。我们已经在我们的数据中心安装并运行了一个托管客户端,为期六个月左右。我们正在与另一个客户端一起在他的环境中进行设置,但是收到错误,表明找不到该方法:
"Information","ajp-bio-8012-exec-1","12/29/15","15:14:32",,"Either there are no methods with the specified method name and argument types or the SendStudentAccountTransaction method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity."
"Information","ajp-bio-8012-exec-1","12/29/15","15:14:32",,"The SendStudentAccountTransaction method was not found."
代码看起来像这样:
<cfif qBilling.RecordCount GT 0>
<cfscript>
ASI2Banner = CreateObject(".NET","ASIBanner.Sender","C:\ASIBanner\ASIBanner.dll");
</cfscript>
<cfdump var="#ASI2Banner#" />
<CFLOOP query="qBilling">
<cflog file="#logfile_name#" text="Sending: #qBilling.TimeframeNumericCode#, #qBilling.StudentNumber#, #qBilling.Account#, #qBilling.Amount#, #qBilling.TxDate#, #qBilling.EffectiveDate#, #qBilling.TxDescription#, #qBilling.StudentBillingInternalID#, '', '', 'Y', 'Y', '', '', 'ASIBanner_Test.txt'" />
<cfset result = ASI2Banner.SendStudentAccountTransaction("#qBilling.TimeframeNumericCode#", "#qBilling.StudentNumber#", "#qBilling.Account#", "#qBilling.Amount#", "#qBilling.TxDate#", "#qBilling.EffectiveDate#", "#qBilling.TxDescription#", "#qBilling.StudentBillingInternalID#", "", "", "Y", "Y", "", "", "ASIBanner_Test.txt") />
<cflog file="#logfile_name#" text="Result: #result#" />
我们收到的日志条目确认我们有要导出的记录,ASIBanner.Sender对象已经创建,并且脚本正在尝试发送第一条记录;但是,呼叫结果没有条目,表明它没有完成。错误发生在该行:
<cfset result = ASI2Banner.SendStudentAccountTransaction("#qBilling.TimeframeNumericCode#", "#qBilling.StudentNumber#", "#qBilling.Account#", "#qBilling.Amount#", "#qBilling.TxDate#", "#qBilling.EffectiveDate#", "#qBilling.TxDescription#", "#qBilling.StudentBillingInternalID#", "", "", "Y", "Y", "", "", "ASIBanner_Test.txt") />
<cflog file="#logfile_name#" text="Result: #result#" />
创建对象时cfdump的结果显示ASIBanner.Sender类确实公开了SendStudentAccountTransaction()方法: {{3}}
我还验证了参数计数和类型匹配。无论是否通过JNBProxyGUI.exe显式设置代理,我都得到相同的结果(当使用代理尝试此操作时,我确实在创建对象时在路径中包含了jar文件)。
我们已经卸载并重新安装了ColdFusion,CF DotNet服务,并将JRE更新为1.8.0.65,但都没有成功。我已经验证DLL没有标记为已阻止,并且正确的.Net框架绑定到IIS中的应用程序池。我清理了{cfusion} \ wwwroot \ WEB-INF \ cfclasses \ dotNetProxy文件夹(保存dotNetCoreProxy.jar)。
令人绝对令人抓狂的是,这个相同的代码在我们的环境中看起来是一个配置相同的服务器上运行得很完美。我知道我必须遗漏一些东西,我只是看不出它是什么。