在Command Box中启动ColdFusion服务器时命令报错退出
Adobe ColdFusion 11 + Command Box 启动时出现 NullPointerException 故障
刚接手ColdFusion项目,首次使用Command Box执行以下命令启动服务器:
server start cfengine=adobe@11 console=true
启动过程中抛出java.lang.NullPointerException,服务器随即停止,核心错误栈指向coldfusion.CfmServlet.init(CfmServlet.java:97),完整日志如下:
[INFO ] Runwar: ****************************************************************************** [INFO ] Runwar: Starting RunWAR 4.8.5 [INFO ] Runwar: Binding HTTP on localhost:8282 [INFO ] Runwar: Enabling HTTP/2 [INFO ] Runwar: Servlet Context: / [INFO ] Runwar: Log Directory: C:\Users\Aaron\.CommandBox\server\DE7764989AC6E02101EEFD566DEBC404-cherokee-leaseapps\adobe-11.0.19.314546\logs [INFO ] Runwar: ****************************************************************************** [INFO ] Runwar: Parsing 'C:\Users\Aaron\.CommandBox\server\DE7764989AC6E02101EEFD566DEBC404-cherokee-leaseapps\adobe-11.0.19.314546\WEB-INF\web.xml' [INFO ] Runwar: Creating deployment [default] in C:\Users\Aaron\Documents\dev\cherokee-leaseapps [INFO ] 05/31 16:08:18 INFO License Service: Flex 1.5 CF Edition enabled [INFO ] 05/31 16:08:18 INFO Starting Flex 1.5 CF Edition [INFO ] 05/31 16:08:18 INFO Macromedia Flex Build: 87315.134646 [ERROR] java.lang.NullPointerException [ERROR] at coldfusion.CfmServlet.init(CfmServlet.java:97) [ERROR] at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:121) [ERROR] at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59) [ERROR] at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [ERROR] at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:309) [ERROR] at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:588) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559) [ERROR] at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) [ERROR] at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [ERROR] at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:601) [ERROR] at runwar.Server.createServletDeployment(Server.java:1360) [ERROR] at runwar.Server.startServer(Server.java:517) [ERROR] at runwar.Start.main(Start.java:51) [ERROR] javax.servlet.ServletException: java.lang.NullPointerException [ERROR] at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:129) [ERROR] at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59) [ERROR] at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [ERROR] at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:309) [ERROR] at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:588) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559) [ERROR] at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) [ERROR] at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [ERROR] at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [ERROR] at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:601) [ERROR] at runwar.Server.createServletDeployment(Server.java:1360) [ERROR] at runwar.Server.startServer(Server.java:517) [ERROR] at runwar.Start.main(Start.java:51) [ERROR] Caused by: java.lang.NullPointerException [ERROR] at coldfusion.CfmServlet.init(CfmServlet.java:97) [ERROR] at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:121) [ERROR] ... 13 more [INFO ] Runwar: ****************************************************************************** [INFO ] Runwar: *** stopping server 'cherokee-leaseapps' (socket 49490) [INFO ] Runwar: ****************************************************************************** Server's output stream closed. It's been stopped elsewhere. Stopping server... ERROR (5.9.0+00721) Server process returned failing exit code [1]
解决步骤
1. 修复目录权限
- 确认
C:\Users\Aaron\.CommandBox\server\和项目目录C:\Users\Aaron\Documents\dev\cherokee-leaseapps的读写权限,给当前用户添加完全控制权限 - 右键目录 → 属性 → 安全 → 编辑权限,确保当前用户拥有读写、修改权限
2. 重置CF服务器实例
- 停止并删除现有服务器:
server stop server remove - 清理Command Box缓存:
cache clear - 重新启动服务器:
server start cfengine=adobe@11 console=true
3. 匹配兼容的Java版本
Adobe CF11仅支持Java 7或Java 8,高版本Java会引发兼容性问题:
- 查看当前Java版本:
java -version - 若版本不符,在项目根目录创建
server.json,指定Java 8路径:
替换{ "jvm": { "javaHome": "C:\\Program Files\\Java\\jdk1.8.0_xxx" } }xxx为实际的Java 8版本号,再重新启动服务器。
4. 排查项目配置冲突
- 暂时重命名项目中的
WEB-INF文件夹,避免自定义配置干扰默认实例 - 检查项目根目录是否存在遗留的
neo-*.xml等ColdFusion配置文件,如有则移除或重命名后重试
内容的提问来源于stack exchange,提问作者Aaron Blakeley
相关产品推荐
相关产品推荐

