
Configure the DB as described in section Config Data Source under OrderController.
In AmazonQ or CoPilot run the following prompt in a new chat:
@Workspace migrate order-controller to Java 17 and to the latest SpringBoot 3
(make sure to respond when prompted by the agent)
Edit the class com.oms.ordercontroller.OrderControllerApp.java
Add the annotations @EntityScan({ "com.oms.entity" }) and @ComponentScan("com.oms")(ensure the double quotes are copied correctly - see above note)
Add the requirement import statements (import org.springframework.boot.autoconfigure.domain.EntityScan; and import org.springframework.context.annotation.ComponentScan;)
The file should be similar to the below (the added lines are marked //added):
package com.oms.ordercontroller;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan; // added
import org.springframework.context.annotation.ComponentScan; // added
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication
@ImportResource({"META-INF/rr/**/*.xml"})
@ComponentScan("com.oms") // added
@EntityScan("com.oms.entity") // added
public class OrderControllerApp {
public static void main(String[] args)
{
SpringApplication.run(OrderControllerApp.class, args);
}
}Compile the service by doing Maven clean and Maven install
Run the service as a Spring Boot App, either from the Spring Boot Dashboard in VS Code (screenshot below)

or by doing in the command window:
cd c:\vFunctionLab\oms-services\order-controller
java -jar .\target\OrderController-1.0-SNAPSHOT.jarCopy the file orders-requests.http from the original git repository to the service folder
copy c:\vFunctionLab\oms-tutorial\oms-services\orders-requests.http c:\vFunctionLab\oms-services\order-controller In VS Code, open the file orders-requests.http
Run the APIs by clicking Send Request above the various REST APIs calls and review the responses (first create orders and then get an order)
Commit the modified files (no need to commit oms-log.txt and launch.json)
