💾Thananjhayan
← Back to notes

Spring Boot — Run, Test & Checklist

May 24, 2026

Run the app and exercise the API — plus the quick fixes and a final checklist.

Run

  1. Find the main class (MyappApplication.java) and run it, or from a terminal in the project folder:
mvn spring-boot:run
  1. Wait until the console shows "Started … Application". The app now runs at http://localhost:8080.

Test

  • Get all items (browser): http://localhost:8080/api/items
  • Auto REST endpoint: http://localhost:8080/items

To create an item, use Postman: POST to http://localhost:8080/api/items → Body → raw → JSON:

{
  "itemName": "Pen",
  "unitPrice": 50,
  "updatedDate": "2026-05-24"
}
  • Update: PUT http://localhost:8080/api/items/1 with a JSON body.
  • Delete: DELETE http://localhost:8080/api/items/1

Quick fixes

  • App won't start / "Unknown database" → the name after the last / in application.properties doesn't match your real database name.
  • "Access denied for user root" → wrong MySQL password in application.properties.
  • "Unknown column" / data not showing → a field name in Item.java doesn't match the table column; add @Column(name = "...").
  • Restored data disappearedddl-auto was create or create-drop. Use update.
  • Port 8080 already in use → add server.port=8081 to application.properties.

Checklist

  • Project generated with the four dependencies (Web, JPA, Rest Repositories, MySQL Driver).
  • Database created, backup restored, application.properties filled in, app connects.
  • Item.java with @Entity, all four fields, both constructors, all getters/setters.
  • ItemRepository interface + ItemController with all five CRUD methods, tested and working.

Back to the overview: [[spring-boot-basics]].

💬 Comments