When attempting to send email using scalate templates, resource not found exceptions are thrown (see below). Initially I thought it was a path issue, as in dev environment on sbt it works file, but deploying the WAR to jetty causes these exceptions.
com.mysite.api.util.mail.EmailActor@324f0f97: caught org.fusesource.scalate.util.ResourceNotFoundException: Could not load resource: [/WEB-INF/scalate/templates/email-forgotpassword.ssp]
org.fusesource.scalate.util.ResourceNotFoundException: Could not load resource: [/WEB-INF/scalate/templates/email-forgotpassword.ssp]
After numerous attempts to actually get jetty to look for the template in the right place, this worked:
val dir = this.getClass.getClassLoader().getResource("/").toExternalForm() + "../scalate/"
but still I get this exception:
org.fusesource.scalate.util.ResourceNotFoundException: Could not load resource: [file:/var/cache/jetty/data/Jetty__8080_mysite_api_2.9.1.0.1.war__api__.1q1r37/webapp/WEB-INF/classes/../scalate/templates/email-forgotpassword.ssp]
The files definitely resides in that exact path, as a directory listing will confirm, so it's not a path issue I don't believe.
Any insight would be greatly appreciated. Thanks!