This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
You will need a Application Client Container (ACC) which will invoke that class. You can't use it as a normal standalone java class because the container is responsible for injecting the resources. I guess Glassfish provides a ACC and their documentation might contain more details.
You can call a EJB from a plain java class using JNDI lookup. However injecting the bean in that plain java class won't work because there will be no container which processes this plain java file for injecting the resource.
Jeffry Kristianto Yanuar
Joined: Oct 01, 2007
Does the plain java class must be run on the same PC which is the server is running ?
If we can do the lookup to JNDI server outside the PC which is the server is running, do we need the IP address of the server ?