This is from Enthuware Test 1 Q1:
However I wrote a quick test and the container (JBoss) did not have an issue with it:
Am I missing something here or is this merely a recommendation of the EJB3 specification?
The important thing to remember is that FinderExceptions, CreateException, and RemoveException are checked application exceptions and must be declared in the throws clause of the method.
Also, beans are not allowed to throw RemoteException. It is the container's responsibility to throw it to the client if the client is a remote client.
Therefore, this code can only throw an EJBException, which is a RuntimeException.
However I wrote a quick test and the container (JBoss) did not have an issue with it:
Am I missing something here or is this merely a recommendation of the EJB3 specification?