私はあまりにも新しいので、herokuにプッシュするためのシンプルなアプリを作成しようとしています。アプリを起動してローカルホストで作業しており、ローカルホストでもmongoDBを実行しています。herokuのアプリにmongoDBを追加しましたが、heroku(DBではなくアプリ)で開きません。問題が何であるかわかりませんが、アプリをheroku DBに接続する必要がありますか?database.propertiesファイルを変更するときのように?このURL(mongoctlを使用してDBに正常にログインするために使用できるURL)を使用して、herokuDBを使用してローカルでテストしようとしました。
mongodb://heroku_app10830648:************************@ds047387.mongolab.com:4738/heroku_app10830648
情報をdatabase.propertiesファイルに入れます。
#Updated at Wed Jan 09 19:16:49 MST 2013
#Wed Jan 09 19:16:49 MST 2013
mongo.database=heroku_app10830648
mongo.host=ds047387.mongolab.com
mongo.password=***********************
mongo.port=47387
mongo.username=heroku_app10830648
しかし、mvnパッケージでビルドすると、次のエラーが発生します。
テスト
結果 :
エラーのあるテスト:testCountAllNotebooks(com.xebia.shortnotes.domain.NotebookIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.notebook lock type:0 client:71.208.224.103" 、"assertionCode":10057、 "errmsg": "db assertion failure"、 "ok":0.0} testFindNotebook(com.xebia.shortnotes.domain.NotebookIntegrationTest):コマンドが失敗しました[command failed [count] {"assertion": "不正なdb:heroku_app10830648 ns:heroku_app10830648.notebookロックタイプ:0client:71.208.224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0} testFindAllNotebooks(com.xebia.shortnotes。 domain.NotebookIntegrationTest):command failed [command failed [count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.notebook lock type:0 client:71.208.224.103"、 "assertionCode":10057、 "errmsg": "db assertion failure"、 "ok":0.0} testFindNotebookEntries(com.xebia.shortnotes.domain.NotebookIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.notebook lock type:0 client:71.208。 224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0} testSaveNotebook(com.xebia.shortnotes.domain.NotebookIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[カウント]{"アサーション" :"不正なdb:heroku_app10830648 ns:heroku_app10830648.notebook lock type:0 client:71.208.224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0} testDeleteNotebook(com.xebia.shortnotes.domain.NotebookIntegrationTest):コマンドfailed [command failed [count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.notebook lock type:0 client:71.208.224.103"、 "assertionCode":10057、 "errmsg": "db assertion failure"、 " ok ":0.0} testCountAllNotes(com.xebia.shortnotes.domain.NoteIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[count] {"assertion ":" unauthorized db:heroku_app10830648 ns:heroku_app10830648.note lock type:0 client:71.208.224.103 "、" assertionCode ":10057、" errmsg ":"dbアサーションの失敗"、" ok ":0.0} testFindNote(com.xebia.shortnotes.domain.NoteIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[カウント] {"アサーション":" unauthorized db:heroku_app10830648 ns:heroku_app10830648.noteロックタイプ: 0 client:71.208.224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0} testFindAllNotes(com.xebia.shortnotes.domain.NoteIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[カウント] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.note lock type:0 client:71.208.224.103"、 "assertionCode":10057、 "errmsg": "db assertion failure"、 "ok":0.0} testFindNoteEntries (com.xebia.shortnotes.domain.NoteIntegrationTest):command failed [command failed [count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.note lock type:0 client:71.208.224.103"、 "assertionCode":10057、 "errmsg": "db assertion failure"、 "ok":0.0} testSaveNote(com.xebia.shortnotes.domain.NoteIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[count] {"assertion": "unauthorized db:heroku_app10830648 ns:heroku_app10830648.note lock type:0 client:71.208。 224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0} testDeleteNote(com.xebia.shortnotes.domain.NoteIntegrationTest):コマンドが失敗しました[コマンドが失敗しました[カウント]{"アサーション" :"unauthorized db:heroku_app10830648 ns:heroku_app10830648.noteロックタイプ:0 client:71.208.224.103 "、" assertionCode ":10057、" errmsg ":" db assertion failure "、" ok ":0.0}
テストの実行:14、失敗:0、エラー:12、スキップ:0
[情報] - - - - - - - - - - - - - - - - - - - - - - - - -------------------------
[エラー]ビルドの失敗
[情報] - - - - - - - - - - - - - - - - - - - - - - - - -------------------------
[情報]テストに失敗しました。
ここでの主な質問は、mvnプロジェクトでローカル以外の別のDBを使用する方法を誰かに教えてもらえるかどうかということです。