-1

We used heroku to host an app, which was built by using java and dagger. Even though heroku deployment was successful, but none of the data (in the java code for testing) was stored in MongoDB atlas. We tried the following ways, but cannot find out a solution.

  1. We test running build locally. The data were stored in MongoDB successfully.
  2. We opened up the ip access with anywhere.
  3. We run heroku log -tails, and everything seems fine.

What possible problems did we encounter? How can we fix them? Thank you.

lucyh
  • 179
  • 2
  • 5
  • 14
  • What happens when you try to save data? – ChrisGPT was on strike May 01 '22 at 18:12
  • Heroku said build successfully, but nothing happened in MongoBD. – lucyh May 01 '22 at 22:26
  • Okay, well, building doesn't generally do anything to your database. What do you expect to see there? – ChrisGPT was on strike May 01 '22 at 22:27
  • I had mock data in Java and expected to see them stored in MongoDB. When we tested locally, new tables were created in the DB. – lucyh May 03 '22 at 00:53
  • You're going to have to provide a lot more information. I suggest you start by adding the [tag:java] tag and either a [mre] or enough information about the libraries you are using so a Java developer might understand. Right now you're getting attention from Heroku and MongoDB folks, only. – ChrisGPT was on strike May 03 '22 at 00:55
  • I finally found out the error: " Error: Unable to access jarfile ./build/libs/myApp.jar". How can I fix it? Thanks. – lucyh May 05 '22 at 00:57

1 Answers1

0

Need to set up the right procfile, e.g., web: java -jar ./build/libs/myApp-all.jar

lucyh
  • 179
  • 2
  • 5
  • 14