0
votes

I'm moving a Grails application from CouldFoundry to AppFog and I'm encountering an Error 310: Staging failed, web.xml not found. The af push is successful but when I try to set an environment variable with env-add or start the app I get the staging error.

There's a previous response to this issue here. I tried installing the latest cloud-foundry plugin as described in that response and the cf-push successfully pushes the app to AppFog but I still get the 310 error.

Error 310: Staging failed: 'Staging task failed:
 Staging plugin failed: /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/java_web/plugin.rb:28:in `block in stage_application': Web application staging failed: web.xml not found (RuntimeError)  
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/java_web/plugin.rb:22:in `chdir'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/java_web/plugin.rb:22:in `stage_application'
from /opt/cloudfoundry/vcap/stager/bin/run_plugin:19:in `<main>'
2
I'm also using Intellij Idea and tried the solution suggested here with no luck. - SeattleStephens

2 Answers

0
votes

I was inadvertently including Tomcat in my WAR file as described by Graeme in this post. When I corrected the Tomcat reference, the staging error was resolved (it was no longer looking for the web.xml file associated with Tomcat).

0
votes

I was running into the same issue and resolved it by renaming the war file to the same name as the application I created on appfog AND running "af update " in the target directory. For some reason, I had been running "af update" without the and I believe that might have been the problem. Anyway, I'm not exactly sure which change worked, but I was able to get my application running after following these steps.

$ grails war target/rw.war
| Packaging Grails application
| Compiling 2 source files..
| Done creating WAR target/rw.war
$ cd target/
$ af update rw