本文介绍了为多服务器中的特定实例添加到ColdFusion类路径Adobe Coldfusion 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Adob​​e ColdFusion 9 Multi-Server在CF Admin中没有JVM和Java设置页面,因此要将某个内容添加到CF类路径中,对于给定的实例,该实例必须以备用jvm开头。 config。



我没有开始使用备用jvm.config的问题。但是,我确实知道正确如何以正确的方式编辑该文件。



我的股票jvm.config看起来像这样(忽略换行符 - 它们不在实际文件中):

  java.args = -server -Xmx512m -Dcoldfusion。 sessioncookie.httponly = true -Dsun.io.useCanonCaches = false -XX:MaxPermSize = 192m -XX:+ UseParallelGC -Xbatch -Djava.awt.headless = true 
-Dcoldfusion.rootDir = {application.home} /
-Djava.security.policy = {application.home} /servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/coldfusion.policy
-Djava.security.auth。 policy = {application.home} /servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/neo_jaas.policy

我更成功的一个尝试添加类的文件夹到类路径看起来像这样。 (这里只是一对夫妇。)

  java.args = -server -Xmx512m -Dcoldfusion.sessioncookie.httponly = true -Dsun .io.useCanonCaches = false -XX:MaxPermSize = 192m -XX:+ UseParallelGC -Xbatch -Djava.awt.headless = true 
-Dcoldfusion.rootDir = {application.home} /
-Djava.security .policy = {application.home} /servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/coldfusion.policy
-Djava.security.auth.policy = {application.home} /servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/neo_jaas.policy
-Dcoldfusion.classPath = {application.home} /servers/hud/cfusion.ear/cfusion.war / WEB-INF / cfusion / lib,/ var / www / apps / onecpd / GeoServices_sandbox

* I说我更成功的一次尝试,因为实例启动,这些类是在CF类路径[我可以实例化它们与createObject()],但实例启动不干净 - 有许多Flex相关的错误:

  jamie @ icf109118-ubuntu:/opt/jrun4/servers/hud/cfusion.ear/cfusion.war/WEB- INF / cfusion / lib $ sudo / opt / jrun4 / bin / jrun -config /opt/jrun4/bin/jvm_onecpd.config start onecpd 
启动Macromedia JRun 4.0(Build 108858),onecpd服务器
03 / 19 11:37:34 info JRun命名服务侦听*:2911
03/19 11:37:35 info没有为此服务器配置JDBC数据源(请参阅jrun-resources.xml)
03/19 11:37:35 info JRun Web服务器监听*:8303
03/19 11:37:35 info JRun代理服务器监听*:51003
03/19 11:37:35 info部署企业应用程序JRun 4.0 Internal J2EE Componentsfrom:file:/opt/jrun4/lib/jrun-comp.ear
03/19 11:37:35 info部署EJBJRunSQLInvokerfrom:file:/ opt / jrun4 / lib / jrun-comp.ear
服务器onecpd就绪(启动时间:2秒)
03/19 11:37:35 info从:file:/ opt部署企业应用程序cfusion /jrun4/servers/onecpd/cfusion.ear/
03/19 11:37:36 info从以下位置部署Web应用程序cfusion:file:/opt/jrun4/servers/onecpd/cfusion.ear/
java.lang.ClassNotFoundException:flex.server.j2ee.cache.CacheFilter
at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:235)
at java.lang.ClassLoader.loadClass(Unknown Source )
at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper.java:123)
at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
在jrun.servlet.FilterObject。 init(FilterObject.java:63)
at jrun.servlet.FilterManager.loadFilter(FilterManager.java:220)
at jrun.servlet.FilterManager.init(FilterManager.java:158)
在jrun.servlet.FilterManager.create(FilterManager.java:75)
在jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
在jrun.ea.EnterpriseApplication.start(EnterpriseApplication.java :194)
at jrun.deployment.DeployerService.initModules(DeployerService.java:708)
at jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
at jrun.deployment。 DeployerService.deploy(DeployerService.java:428)
at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
at jrun.deployment.DeployerService.run(DeployerService.java:889)
at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
在jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java:428)
在jrunx.scheduler.WorkerThread.run (WorkerThread.java:66)
03/19 11:37:36用户无法加载:flex.server.j2ee.cache.CacheFilter
03/19 11:37:36错误加载类为过滤器CFCacheFilter:禁用过滤器。
[1] java.lang.ClassNotFoundException:flex.server.j2ee.cache.CacheFilter
at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:235)
在java.lang。 ClassLoader.loadClass(unknown Source)
at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper.java:123)
at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
at jrun.servlet.FilterObject.init(FilterObject.java:63)
在jrun.servlet.FilterManager.loadFilter(FilterManager.java:220)
在jrun.servlet.FilterManager.init(FilterManager.java: 158)
at jrun.servlet.FilterManager.create(FilterManager.java:75)
at jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
at jrun.ea.EnterpriseApplication .start(EnterpriseApplication.java:194)
在jrun.deployment.DeployerService.initModules(DeployerService.java:708)
在jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
在jrun.deployment.DeployerService.deploy(DeployerService.java:428)
在jrun.deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
在jrun.deployment.DeployerService.run(DeployerService。 java:889)
在jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
在jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java:428)
在jrunx .scheduler.WorkerThread.run(WorkerThread.java:66)
[0] javax.servlet.ServletException:flex.server.j2ee.cache.CacheFilter
at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper。 java:132)
at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
在jrun.servlet.FilterObject.init(FilterObject.java:63)
在jrun.servlet .FilterManager.loadFilter(FilterManager.java:220)
在jrun.servlet.FilterManager.init(FilterManager.java:158)
在jrun.servlet.FilterManager.create(FilterManager.java:75)
at jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
at jrun.ea.EnterpriseApplication.start(EnterpriseApplication.java:194)
at jrun.deployment.DeployerService.initModules( DeployerService.java:708)
at jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
at jrun.deployment.DeployerService.deploy(DeployerService.java:428)
at jrun .deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
在jrun.deployment.DeployerService.run(DeployerService.java:889)
在jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230 )
at jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

请注意,不添加{application.home} /servers/hud/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib Dcoldfusion.classPath,以及,服务器不会真正开始。



那么,什么是干净地添加东西到ColdFusion类路径在jvm的神奇公式。 config?

解决方案

来自Christian Cantrell - 工程经理和Evangelist,我给你(虽然有点过时)



这里是我认为与您的设置相关的部分的摘录:



strong>


  1. 将类或jar文件添加到类路径中的最简单的方法是将它们放在lib目录它们会自动拾取。该目录位于{cf_installation} / servers / lib。


  2. 您还可以将您的类文件仅提供给ColdFusion服务器,方法是将它们放在{cf_installation} servers / default / cfmx / WEB-INF / lib。 (注意,将它们放在{cf_installation} / servers / default / cfmx / WEB-INF / cfusion / lib中将不起作用。)


  3. 在任何Java扩展目录中。要查找Java扩展目录的列表,请打开ColdFusion管理员并单击系统信息。在底部,您将看到一个名为Java Ext Dirs的系统属性。


  4. 另一种方法是通过添加类来添加类。 JRun管理控制台。打开控制台,在默认服务器下,单击设置,然后将类添加到类路径列表。 (注意,您也可以点击默认服务器下的ColdFusion MX应用程序,然后点击设置进行相同的更改。)






从以下注释更新



编辑jvm.config文件时(选项5) ,请尝试将目录路径添加到jvm.config文件(底部)中的 java.class.path = 行。不在 java.args = 中,就像您在发布示例中所做的那样。


Adobe ColdFusion 9 Multi-Server doesn't have the "JVM and Java Settings" page in the CF Admin, so to add something to the CF classpath, for a given instance, that instance must be started with an alternate jvm.config.

I don't have a problem with starting with an alternate jvm.config. I do, however, have a problem knowing precisely how to edit that file in the proper way.

My stock jvm.config looks like this (ignore line breaks--they are not in the actual file):

java.args=-server -Xmx512m -Dcoldfusion.sessioncookie.httponly=true -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Djava.awt.headless=true
-Dcoldfusion.rootDir={application.home}/
-Djava.security.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/coldfusion.policy
-Djava.security.auth.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/neo_jaas.policy

One of my more successful* attempts at adding a folder of classes to the classpath looks like this. (Here are just a couple.)

java.args=-server -Xmx512m -Dcoldfusion.sessioncookie.httponly=true -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Djava.awt.headless=true
-Dcoldfusion.rootDir={application.home}/
-Djava.security.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/coldfusion.policy
-Djava.security.auth.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/neo_jaas.policy
-Dcoldfusion.classPath={application.home}/servers/hud/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib,/var/www/apps/onecpd/GeoServices_sandbox

*I say "one of my more successful attempts" because the instance does start, and those classes are on the CF classpath [I can instantiate them with createObject()], but the instance start is not clean--there are many Flex-related errors:

jamie@icf109118-ubuntu:/opt/jrun4/servers/hud/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib$ sudo /opt/jrun4/bin/jrun -config /opt/jrun4/bin/jvm_onecpd.config start onecpd
Starting Macromedia JRun 4.0 (Build 108858), onecpd server
03/19 11:37:34 info JRun Naming Service listening on *:2911
03/19 11:37:35 info No JDBC data sources have been configured for this server (see jrun-resources.xml)
03/19 11:37:35 info JRun Web Server listening on *:8303
03/19 11:37:35 info JRun Proxy Server listening on *:51003
03/19 11:37:35 info Deploying enterprise application "JRun 4.0 Internal J2EE Components" from: file:/opt/jrun4/lib/jrun-comp.ear
03/19 11:37:35 info Deploying EJB "JRunSQLInvoker" from: file:/opt/jrun4/lib/jrun-comp.ear
Server onecpd ready (startup time: 2 seconds)
03/19 11:37:35 info Deploying enterprise application "cfusion" from: file:/opt/jrun4/servers/onecpd/cfusion.ear/
03/19 11:37:36 info Deploying web application "cfusion" from: file:/opt/jrun4/servers/onecpd/cfusion.ear/
java.lang.ClassNotFoundException: flex.server.j2ee.cache.CacheFilter
    at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:235)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper.java:123)
    at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
    at jrun.servlet.FilterObject.init(FilterObject.java:63)
    at jrun.servlet.FilterManager.loadFilter(FilterManager.java:220)
    at jrun.servlet.FilterManager.init(FilterManager.java:158)
    at jrun.servlet.FilterManager.create(FilterManager.java:75)
    at jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
    at jrun.ea.EnterpriseApplication.start(EnterpriseApplication.java:194)
    at jrun.deployment.DeployerService.initModules(DeployerService.java:708)
    at jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
    at jrun.deployment.DeployerService.deploy(DeployerService.java:428)
    at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
    at jrun.deployment.DeployerService.run(DeployerService.java:889)
    at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
03/19 11:37:36 user failed to load: flex.server.j2ee.cache.CacheFilter
03/19 11:37:36 error Error loading class for Filter CFCacheFilter: Filter is disabled.
[1]java.lang.ClassNotFoundException: flex.server.j2ee.cache.CacheFilter
    at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:235)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper.java:123)
    at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
    at jrun.servlet.FilterObject.init(FilterObject.java:63)
    at jrun.servlet.FilterManager.loadFilter(FilterManager.java:220)
    at jrun.servlet.FilterManager.init(FilterManager.java:158)
    at jrun.servlet.FilterManager.create(FilterManager.java:75)
    at jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
    at jrun.ea.EnterpriseApplication.start(EnterpriseApplication.java:194)
    at jrun.deployment.DeployerService.initModules(DeployerService.java:708)
    at jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
    at jrun.deployment.DeployerService.deploy(DeployerService.java:428)
    at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
    at jrun.deployment.DeployerService.run(DeployerService.java:889)
    at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
[0]javax.servlet.ServletException: flex.server.j2ee.cache.CacheFilter
    at coldfusion.bootstrap.ClassloaderHelper.initFilterClass(ClassloaderHelper.java:132)
    at coldfusion.bootstrap.BootstrapFilter.init(BootstrapFilter.java:34)
    at jrun.servlet.FilterObject.init(FilterObject.java:63)
    at jrun.servlet.FilterManager.loadFilter(FilterManager.java:220)
    at jrun.servlet.FilterManager.init(FilterManager.java:158)
    at jrun.servlet.FilterManager.create(FilterManager.java:75)
    at jrun.servlet.WebApplicationService.start(WebApplicationService.java:230)
    at jrun.ea.EnterpriseApplication.start(EnterpriseApplication.java:194)
    at jrun.deployment.DeployerService.initModules(DeployerService.java:708)
    at jrun.deployment.DeployerService.createWatchedDeployment(DeployerService.java:243)
    at jrun.deployment.DeployerService.deploy(DeployerService.java:428)
    at jrun.deployment.DeployerService.checkWatchedDirectories(DeployerService.java:179)
    at jrun.deployment.DeployerService.run(DeployerService.java:889)
    at jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java:230)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Note that without adding {application.home}/servers/hud/cfusion.ear/cfusion.war/WEB-INF/cfusion/lib to Dcoldfusion.classPath, as well, the server wouldn't really start at all.

So, what is the magic formula for cleanly adding something to the ColdFusion classpath in jvm.config?

解决方案

From Christian Cantrell - Engineering Manager and Evangelist, I give you The Definitive Guide to the ColdFusion Classpath (although it is a bit dated)

Here is an excerpt of the portion that I think relates to your setup:

J2EE Deployment

  1. The easiest way to add class or jar files to your class path is to simply drop them in the lib directory where they are automatically picked up. The directory is located at {cf_installation}/servers/lib. These class files will be available to all servers.

  2. You can also make your class files available only to the ColdFusion server by dropping them in "{cf_installation}/servers/default/cfmx/WEB-INF/lib". (Note that putting them in {cf_installation}/servers/default/cfmx/WEB-INF/cfusion/lib will NOT work.)

  3. You can drop them in any of the Java extension directories. To find a list of the Java extension directories, open the ColdFusion administrator and click on "System Information". Toward the bottom, you will see a system property called "Java Ext Dirs". You can put jar and class files in any of those directories to have them picked up by the ColdFusion server.

  4. Another way to do it is to add classes through the JRun Management Console. Open up the console, and under the default server, click on settings, then add your classes to the class path list. (Note you can also click on "ColdFusion MX application" under the default server, then click on settings to make the same changes.)

  5. And finally, once again, you can edit the jvm.config file yourself, however again, I recommend you stick to using one of the methods above.

UPDATE from the comments below

When editing the jvm.config file (option 5), try adding the directory path to the java.class.path= line in the jvm.config file (at the bottom). Not in the java.args= as you have done in the posted example.

这篇关于为多服务器中的特定实例添加到ColdFusion类路径Adobe Coldfusion 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 17:11