在本地(在 Windows 上)开发我的测试应用程序时,我的应用程序运行良好,没有问题。
在部署到 heroku(使用 git)并调用特定的 GET 后,我收到了一个错误。花费大量时间尝试调试问题 - 无法在本地复制,我找到了导致它的区域(通过评论/取消评论代码区域)
这是在 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上运行良好
这是异常(从第一个代码段生成的异常)
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)
路由文件相关行
* /compose 应用程序.compose
我的问题是
- 我做错了什么(以及为什么我所做的更改修复了它)?
- 为什么它不能在本地复制?