Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
3) Create a New Package called test under the Source Package Folder.
Create a new interface called "Home".under test package and add the code.
HomeImpl.java :
package test;
import javax.ejb.Stateless;
@Stateless
public class HomeImpl implements Home{
@Override
public String sayHello(String name) {
return "Welcome to EJB"+" "+name;
}
}
package test;
import javax.ejb.Stateless;
@Stateless
public class HomeImpl implements Home{
@Override
public String sayHello(String name) {
return "Welcome to EJB"+" "+name;
}
}
6) Set the JNDI Name for the HomeImpl Bean by editing the file or by clicking the TAB "EJB" and
giving jndi name as "abc".
7) Right click on the Project Node and select clean and Build.
After clean and build again right click on the project node and select "Deploy".
8) RightClick on the Project Node (MyApp) and create new Class called "Main"
Main.java :
package test;
import java.util.Properties;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;