2015-01-08 41 views
-1

我想通过运行grails tomcat deploy通过tomcat插件部署Grails应用程序。当这样做的时候,它可以很好地工作,除了WAR文件中的所有配置都是它们的开发值(开发数据源试图从我部署的WAR文件中使用)。运行'grails tomcat deploy'时出现java.io.IOException

我再尝试运行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。

+0

如果[谷歌的错误消息引用(https://开头www.google.com/search?q="Error+writing+request+body+to+server"+tomcat)你会得到很多点击 –

+0

我看了一下这些决议(当有决议时),但没有似乎在这里解决了这个问题。 – Casey

+0

如果更改环境会导致部署失败,这是否有可能是一个错误? – Casey

回答

0

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

Grails Tomcat Plugin Docs

的Tomcat 7 如果您使用的是Tomcat 7,确保用户具有管理员脚本的作用

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

我确实有管理员脚本角色,这是我首先获得这项工作所需要的。问题是当环境设置为生产时,部署不起作用。 – Casey

+0

你可以发布你在config.groovy中有什么吗? – thepner

相关问题