简体   繁体   中英

Application error in heroku using java playframework

I'm trying to publish a Play framework application in Heroku. I followed the instructions from here . I'm also having the following dependencies

   java
   play framework 1.2.4
   mongolab
   morphia 1.6.2a

When i open application in the heroku using commang "heroku open". It shows the error as follows..,

Oops, an error occured

This exception has been logged with id 6ac06o8hm.

But the project runs locally without any issues, pointing to a local MongoDB database.

Exception

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)

UPDATE

-----> 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'

Looking at the logs I can see that there is a null pointer exception, so one of the things as below could be the reason:

  1. There is a non initialized variable passed
  2. There is a non registered error
  3. There is a method call on an empty collection
  4. The connection is passed by an empty request

You need to check all the above possibilities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM