6

I try to deploy my Grails 2.1.1 application to Heroku.

I run git push master heroku and it runs for a while (compiles alright, get dependencies, ec), then it gives me this message:

|Building WAR file
   ...........................Error 
   |
   Error executing script War: : Replace: source file /app/.grails/2.1.1/projects/Project/stage/WEB-INF/applicationContext.xml doesn't exist (Use --stacktrace to see the full trace)
 !     Failed to build app
 !     Heroku push rejected, failed to compile Grails app

When I run grails war locally, it works without any issues.

I have done some reading but I haven't found a solid answer. Similar issues that I have read about have been caused by JDK-related issues, or plugins.

marko
  • 3,736
  • 6
  • 29
  • 46
  • What version of grails are you using locally? Can you run a one-off command on your dyno to check if applicationContext.xml exists? – culix Feb 17 '13 at 21:36
  • when you do git status, are there any files that are not checked in or in your ignore list? – Tomas Lin Feb 17 '13 at 21:39
  • @tomas git status tells me I have no changes. The ignore list was taken från GitHub. – marko Feb 18 '13 at 07:36
  • @culix Locally I'm not sure, I'll have to double check. How do I give the command? – marko Feb 18 '13 at 07:36
  • @marko To check the version try `grails -version` - [see here](http://grails.org/doc/latest/guide/gettingStarted.html) – culix Feb 18 '13 at 17:51
  • @culix well, that gave me 2.1.1 as I wrote in the question. But one thing I noticed (I use STS) that it compiles with 2.0.4 according to my preferences. Any ideas? – marko Feb 18 '13 at 21:44
  • @marko Sorry I mistyped - I meant to ask: what version of the Heroku Toolbelt are you using? `heroku --version` – culix Feb 19 '13 at 04:52
  • @culix I don't really know how to check that, spoon feed me pls :) – marko Feb 19 '13 at 08:06
  • @culix this is what heroku --version gave me: heroku-toolbelt/2.35.0 (x86_64-darwin10.8.0) ruby/1.9.3 – marko Feb 20 '13 at 19:36
  • I just noted that the path supplied in the error message is a reference to my local dev env. Shouldn't it look for it in a war-file? – marko Feb 20 '13 at 19:39
  • For the record, I found this : http://grails.1312388.n4.nabble.com/grails-war-applicationContext-xml-doesn-t-exist-td1334855.html but I had already tried upgrade and it didn't do anything for me. – marko Feb 20 '13 at 19:47

1 Answers1

10

The solution in this case was to add WEB-INF to my repository. By the default my .gitignore (created via GitHub) ignores WEB-INF.

marko
  • 3,736
  • 6
  • 29
  • 46