I actually thought we did have sleep in the tutorial builds to wait for a few seconds before the application is deployed. But looking at it now, I don't see any. So yes, as Wolfgang suggests, you might want to add that sleep in the build. Or you can run the "ejbjar" and the "run" target separately:
ant ejbjar
and then check the server console to see that the application is deployed. After the application is deployed, run
ant run