在ColdFusion 9中使用Java库

时间:2012-11-20 18:44:04

标签: java coldfusion iis-7.5 coldfusion-9

我目前正在运行一个Java应用程序,它应用一些自然语言处理技术来分析数据。此应用程序包括Java类文件和1个.bin扩展库 该应用程序在我的开发服务器上运行正常但在实时服务器上我得到以下错误:

对象实例化异常。
实例化Java对象时发生异常。该类不能是接口或抽象类。 Error: opennlp/tools/util/ObjectStream.

  

Stack Trace java.lang.NoClassDefFoundError:   opennlp /工具/ UTIL / ObjectStream           at java.lang.Class.getDeclaredFields0(Native Method)           at java.lang.Class.privateGetDeclaredFields(Class.java:2291)           at java.lang.Class.privateGetPublicFields(Class.java:2324)           在java.lang.Class.getFields(Class.java:1359)           at coldfusion.runtime.java.ObjectHandler.Initialize(ObjectHandler.java:35)           at coldfusion.runtime.java.ObjectHandler。(ObjectHandler.java:30)           at coldfusion.runtime.java.ReflectionCache $ 1.fetch(ReflectionCache.java:29)           at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)           at coldfusion.util.SoftCache.get(SoftCache.java:81)           at coldfusion.runtime.java.ReflectionCache.get(ReflectionCache.java:36)           at coldfusion.runtime.java.JavaProxy。(JavaProxy.java:35)           at coldfusion.runtime.java.JavaProxyFactory.getProxy(JavaProxyFactory.java:89)           at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)           at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5002)           at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4966)           at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4907)           at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4885)           at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4842)           在cfWord_Cloud_Report2ecfm2061667591.runPage(E:\ sites \ SignatureWebMedical.Com \ cf_modules \ reports \ sounding \ Word_Cloud_Report.cfm:40)           在coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)           at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)           at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)           在cfindex2ecfm1980726432._factor0(E:\ sites_virtualdirs \ admin \ reports \ index.cfm:425)           在cfindex2ecfm1980726432._factor7(E:\ sites_virtualdirs \ admin \ reports \ index.cfm:403)           在cfindex2ecfm1980726432._factor8(E:\ sites_virtualdirs \ admin \ reports \ index.cfm:188)           在cfindex2ecfm1980726432.runPage(E:\ sites_virtualdirs \ admin \ reports \ index.cfm:1)           在coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)           at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)           at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)           at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:360)           at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)           at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)           at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)           at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)           at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)           at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)           at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)           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:126)           at coldfusion.CfmServlet.service(CfmServlet.java:200)           at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)           在jrun.servlet.FilterChain.doFilter(FilterChain.java:86)           at com.intergral.fusionreactor.filter.FusionReactorFilter.b(FusionReactorFilter.java:376)           在com.intergral.fusionreactor.filter.FusionReactorFilter.c(FusionReactorFilter.java:254)           at com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java:164)           在jrun.servlet.FilterChain.doFilter(FilterChain.java:94)           at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)           at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)           在jrun.servlet.FilterChain.doFilter(FilterChain.java:94)           在jrun.servlet.FilterChain.service(FilterChain.java:101)           在jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)           在jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)           在jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)           在jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)           at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)           在jrunx.scheduler.ThreadPool $ DownstreamMetrics.invokeRunnable(ThreadPool.java:320)           在jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java:428)           在jrunx.scheduler.ThreadPool $ UpstreamMetrics.invokeRunnable(ThreadPool.java:266)           在jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)   引起:java.lang.ClassNotFoundException:opennlp.tools.util.ObjectStream           at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:235)           在java.lang.ClassLoader.loadClass(ClassLoader.java:248)           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)           ......还有61个

在我看来,这是一个类路径问题。我在Dev服务器上遇到了同样的问题,但是通过将我的所有文件放在Cold Fusion 9目录中来修复它:C:\ColdFusion9\runtime\servers\lib 当我将类文件和库.bin文件放在Live服务器上的同一文件夹中时,它不起作用。 每次添加/删除类文件和.bin文件时,我都会重新启动生产服务器。

3 个答案:

答案 0 :(得分:2)

您是否检查过ColdFusion Administrator Java JVM设置中是否添加了类路径?

答案 1 :(得分:0)

这可能与您正在处理的内容类似:https://newrelic.com/docs/java/installing-the-java-agent-on-coldfusion

答案 2 :(得分:0)

我的问题是Windows的版本。在开发中我们使用的是Windows Server 2008 R2,在生产时我们使用的是Windows Server 2008 SP2,它基于我在线阅读的内容,它们有很多不同之处(次要但很重要)我们在星期五更新了生产服务器,一切都开始工作了。感谢所有回复此帖的人。