我正在尝试在Heroku中发布Play框架应用程序。我按照here的说明进行操作。我也有以下依赖
java
play framework 1.2.4
mongolab
morphia 1.6.2a
当我使用commang“heroku open”在heroku中打开应用程序时。它显示错误如下..,
Oops, an error occured
This exception has been logged with id 6ac06o8hm.
但该项目在本地运行时没有任何问题,指向本地MongoDB数据库。
异常
2012-05-14T10:17:30+00:00 app[web.1]:
2012-05-14T10:17:30+00:00 app[web.1]: NullPointerException occure
d : null
2012-05-14T10:17:30+00:00 app[web.1]: at play.mvc.ActionInvoker
.invoke(ActionInvoker.java:231)
2012-05-14T10:17:30+00:00 app[web.1]: play.exceptions.JavaExecuti
onException
2012-05-14T10:17:30+00:00 app[web.1]: at Invocation.HTTP Reques
t(Play!)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.CommandRes
ult.getException(CommandResult.java:64)
2012-05-14T10:17:30+00:00 app[web.1]: Caused by: java.lang.NullPo
interException
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBPort.che
ckAuth(DBPort.java:308)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBTCPConne
ctor.call(DBTCPConnector.java:201)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.CommandRes
ult.throwOnError(CommandResult.java:116)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBApiLayer
$MyCollection.__find(DBApiLayer.java:303)
2012-05-14T10:17:30+00:00 heroku[router]: GET smooth-lightning-41
34.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=
58ms status=500 bytes=417
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBCursor._
hasNext(DBCursor.java:490)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBCursor._
check(DBCursor.java:360)
2012-05-14T10:17:30+00:00 app[web.1]: at com.google.code.morphi
a.query.QueryImpl.asList(QueryImpl.java:255)
2012-05-14T10:17:30+00:00 app[web.1]: at com.mongodb.DBCursor.h
asNext(DBCursor.java:515)
2012-05-14T10:17:30+00:00 app[web.1]: at play.modules.morphia.M
odel$MorphiaQuery.asList(Model.java:1320)
更新
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Play! app detected
-----> Installing Play! -.....
-----> Error installing Play! framework or unsupported Play! fram
ework version specified. Please review Dev Center for a list of s
upported versions.
! Heroku push rejected, failed to compile Play! app
To git@heroku.com:young-spring-3743.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:young-spring-3
743.git'
答案 0 :(得分:1)
查看日志我可以看到有一个空指针异常,所以下面的一个原因可能是:
您需要检查以上所有可能性。