运行 'grails tomcat deploy' 时出现 java.io.IOException

标签 java tomcat grails

我正在尝试通过运行 grails tomcat deploy 通过 tomcat 插件部署 Grails 应用程序。这样做时它工作得很好,除了我在 WAR 文件中的所有配置都是它们的开发值(例如,开发数据源试图从我部署的 WAR 文件中使用)。

然后我尝试运行 grails prod tomcat deploy,出现以下错误:

| Done creating WAR target/app##0.1-build-004.war
Deploying application /app to Tomcat
| Error Error executing script Tomcat: : java.io.IOException: Error writing request body to server (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
: java.io.IOException: Error writing request body to server
        at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:267)
        at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
        at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:141)
        at Tomcat$_run_closure1.doCall(Tomcat:31)
        at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
        at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
        at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:591)
        at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.io.IOException: Error writing request body to server
        at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:220)
        ... 24 more
| Error Error executing script Tomcat: : java.io.IOException: Error writing request body to server

有谁知道为什么会这样?我正在使用 Grails 2.4.4 和 Java 7u71。

最佳答案

对于 tomcat 7+,您需要在 tomcat-users.xml 中为您的用户添加 manager-script 角色。

来自 Grails Tomcat Plugin Docs :

Tomcat 7 如果您使用的是 Tomcat 7,请确保用户具有 manager-script 角色

<user username="manager" password="secret" roles="manager-script" />

关于运行 'grails tomcat deploy' 时出现 java.io.IOException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27846200/

相关文章:

grails - 使用Spring Security UI插件登录自定义字段

java - 设计问题: is this doable only with producer/consumer?

java - Gson 解析不带引号的值

maven - tomcat7-maven-plugin 部署 spring boot 并选择合适的 spring 配置文件

java - org.apache.tomcat.jdbc.pool.ConnectionPool - 无法创建池的初始连接

grails - 在同一测试中创建graphGraphbaseService时找不到节点

grails - 特定域的HQL查询是否应特定于该域?

java - 将值从 servlet 传递到 jsp 页面

java - 从 keyOutputText android 获取文本

java - Spring ControllerAdvice ExceptionHandler 不起作用