2015-01-08 40 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

相關問題