找不到ColdFusion组件或接口javaloader.JavaLoader

时间:2016-12-09 16:07:50

标签: java coldfusion

不引用为什么这不适用于我的本地。它在我的远程测试环境中工作。目前的代码:

<cfset local = {}>
<cfset local.paths = []>
<cfset local.paths[1] = GetDirectoryFromPath(GetCurrentTemplatePath()) & "lib\jsoup-1.7.2.jar">
<cfset local.javaloader = createObject("component", "javaloader.JavaLoader").init(local.paths)>
<cfset jSoupClass = local.javaloader.create( "org.jsoup.Jsoup" )>

它在<cfset local.javaloader....>

上出错

有什么想法吗? #local#正在找到正确的jsoup-1.7.2.jar

浏览器错误:

coldfusion.runtime.CfJspPage$NoSuchTemplateException: Could not find the ColdFusion component or interface javaloader.JavaLoader.
    at coldfusion.runtime.TemplateProxyFactory.getResolvedFile(TemplateProxyFactory.java:1407)
    at coldfusion.runtime.TemplateProxyFactory.getTemplateFileHelper(TemplateProxyFactory.java:1642)
    at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:51)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:6352)
    at coldfusion.runtime.CFPage.CreateObject(CFPage.java:6371)
    at cfquote_htmlparser2ecfm1800247286.runPage(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules\tools\quote_htmlparser.cfm:8)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:251)
    at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3698)
    at cfquoteadder2ecfm646267101.runPage(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules\tools\quoteadder.cfm:24)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:251)
    at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3698)
    at cfmodules2ecfm877363338._factor1(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules.cfm:47)
    at cfmodules2ecfm877363338._factor5(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules.cfm:45)
    at cfmodules2ecfm877363338._factor9(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules.cfm:31)
    at cfmodules2ecfm877363338._factor10(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules.cfm:28)
    at cfmodules2ecfm877363338.runPage(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\modules.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:251)
    at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3698)
    at cfbody2ecfm524231656._factor11(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\body.cfm:246)
    at cfbody2ecfm524231656.runPage(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\body.cfm:1)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:251)
    at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573)
    at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3698)
    at cfportal2ecfm1302691009.runPage(C:\Users\Charles\Documents\GitHub\MilestonePortal\MilestonePortalV2\portal.cfm:144)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:251)
    at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:737)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:573)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:505)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:153)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
    at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:151)
    at coldfusion.CfmServlet.service(CfmServlet.java:219)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:536)
    at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:898)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

3 个答案:

答案 0 :(得分:1)

两个提示,环境变化和NoSuchTemplateException,建议您查看Coldfusion Administrator中的映射。您可能已经省略了Javaloader映射或在当前环境中错误地定义了它。

假设您正在使用Mark Mandel's Javaloader,并将其解压缩为文件夹 javaloader_v1.1 。然后,您应该将映射定义为:

逻辑路径: / javaloader

目录路径: {absolute_path_to_folder_javaloader_v1.1} / javaloader /

答案 1 :(得分:0)

你真的有一个名为“javaloader.Javaloader”的CFC吗?这对我来说听起来像是一个Java类。试试这个:

<cfset local = {}>
<cfset local.paths = []>
<cfset local.paths[1] = GetDirectoryFromPath(GetCurrentTemplatePath()) & "lib\jsoup-1.7.2.jar">
<cfset local.javaloader = createObject("java", "javaloader.JavaLoader").init(local.paths)>
<cfset jSoupClass = local.javaloader.create( "org.jsoup.Jsoup" )>

还要记住Java类和文件名区分大小写。所以你需要精确匹配它们。

答案 2 :(得分:0)

我在Application.cfc中找不到本地路径但在生产服务器上工作时遇到类似问题。我本周向Adobe报告了这个问题。一位同事遇到了同样的问题,尤其是相对路径。 CF 11更新10.

尝试使用//而不是GetDirectoryFromPath的完整路径来查看它是否有效。

另外,请注意任何HTML注释标记(2个破折号)代替CF注释标记。

这是否适用于您当地的人?如果是这样,会发生什么变化?