You will get the error message when,
1. The total license number has been exceeded.
2. You may have many available licenses, but not in the unservered pool.
For example: You have 10 java license. You have reserver 5 license to system profile 1, and 3 license to system profile 2, so you have only 2 licenses left. If another 3 agents try to connect system profile 3, then the third agent will get the license error.