在本地開發我的測試應用程序(在Windows上)時,我的應用程序沒有問題。播放框架重定向錯誤
部署到heroku上(使用GIT)和調用特定GET i之後接收到錯誤。花費很多時間試圖調試的問題 - 不能在本地複製,我發現,導致它的面積(通過評論/取消註釋代碼區)
這裏是代碼,在Heroku 沒有工作:
public static void compose(){
compose("");
}
public static void compose(String content){
render(content);
}
改變上述後:
public static void compose(){
String content = "";
renderTemplate("Application/compose.html",content);
}
public static void compose(String content){
renderTemplate("Application/compose.html",content);
}
應用工作在Heroku精細
這裏是例外(一個從第一碼segmant生成)
Internal Server Error (500) for request GET /compose
2012-03-03T10:37:14+00:00 app[web.1]: @69hmkdf00
2012-03-03T10:37:14+00:00 app[web.1]:
2012-03-03T10:37:14+00:00 app[web.1]: Oops: UnexpectedException
2012-03-03T10:37:14+00:00 app[web.1]: An unexpected error occured caused by exception UnexpectedException: Unexpected Error
2012-03-03T10:37:14+00:00 app[web.1]: play.exceptions.UnexpectedException: Unexpected Error
2012-03-03T10:37:14+00:00 app[web.1]:
2012-03-03T10:37:14+00:00 app[web.1]: at play.vfs.VirtualFile.contentAsString(VirtualFile.java:180)
2012-03-03T10:37:14+00:00 app[web.1]: at play.templates.TemplateLoader.load(TemplateLoader.java:69)
2012-03-03T10:37:14+00:00 app[web.1]: at play.templates.TemplateLoader.load(TemplateLoader.java:172)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.Controller.renderTemplate(Controller.java:640)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.Controller.render(Controller.java:695)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.Controller.renderTemplate(Controller.java:659)
2012-03-03T10:37:14+00:00 app[web.1]: at controllers.Application.compose(Application.java:92)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
2012-03-03T10:37:14+00:00 app[web.1]: at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
2012-03-03T10:37:14+00:00 app[web.1]: at Invocation.HTTP Request(Play!)
2012-03-03T10:37:14+00:00 app[web.1]: at play.vfs.VirtualFile.inputstream(VirtualFile.java:111)
2012-03-03T10:37:14+00:00 app[web.1]: at play.vfs.VirtualFile.contentAsString(VirtualFile.java:178)
2012-03-03T10:37:14+00:00 app[web.1]: Caused by: play.exceptions.UnexpectedException: Unexpected Error
2012-03-03T10:37:14+00:00 app[web.1]: ... 12 more
2012-03-03T10:37:14+00:00 app[web.1]: Caused by: java.io.FileNotFoundException: /app/app/views (Is a directory)
2012-03-03T10:37:14+00:00 app[web.1]: at java.io.FileInputStream.<init>(FileInputStream.java:137)
2012-03-03T10:37:14+00:00 app[web.1]: at java.io.FileInputStream.open(Native Method)
2012-03-03T10:37:14+00:00 app[web.1]: ... 13 more
2012-03-03T10:37:14+00:00 app[web.1]: at play.vfs.VirtualFile.inputstream(VirtualFile.java:109)
路線文件的相關行
* /撰寫Application.compose
我的問題是
- 我做錯了什麼(&爲什麼我修改了它)?
- 爲什麼它不能在本地重現?
這很奇怪。如果你在'prod'模式下本地運行,你能重現錯誤嗎? – 2012-03-03 15:56:03
FileNotFoundException適用於/ app/app/views,這很奇怪。附加/應用程序來自哪裏?嗯 – basav 2012-03-03 16:39:07
@JamesWard我本地嘗試(在生產模式),沒有重現。 – james 2012-03-03 22:11:32