Current setup:
MainProject which is a Library Project
BranchProject which is a new projects and has MainPr
Most of the time it happens when specific source folder are not added in build path Sources tab.
Right-click on the Project in the Package-Explorer, click Build Path -> Configure Build Path -> Source Tab
Add the source folder if your project source folder is not there. Select Add folder -> select your project source folder specifically. Eg: project_name/src . Then Apply it and restart server.