I solved the problem finally. Thanks to the author Kathy of "Head First EJB".
For someone having the same problem, try this out:
When you deploy using J2EE RI Deploytool, you need to change the setting first.
Go to the Security Tab under your Bean application.
Then click on the button "Deployment Settings"
Then click the radio button "Support Client Choice".
Then deploy it again.
It works.