shark
shark

Reputation: 15

Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor error coming on my controller class

//added image

@RestController
public class EmployeeController {

@Autowired
private EmployeeService es;

@RequestMapping(value="/{id}", method=RequestMethod.GET)    
public Employee getEmployeeByID(@PathVariable Long id)
{

    return es.getEmployeeByID(id)
            .orElseThrow(() -> new ResourceNotFoundException("User not found with id :" + id));
}}

Upvotes: 0

Views: 429

Answers (1)

Mystery
Mystery

Reputation: 1

You are getting error message in Eclipse because your Java library in not in project build path. You can configure is as following.

  1. Right-click on project and then click on properties.

  2. Click on Java Build Path.

  3. Click on Libraries and then click on classpath.

  4. Click on Add Library and then select your JDK.

  5. Click on Apply and Close.

  6. Clean and build the project from Project menu on the top of the Eclipse.

Upvotes: 0

Related Questions