Session Bean 中JNDI名称设置

首先在项目中要导入两个jar 包:jboss-ejb3.jar与jboss-annotations-ejb3.jar(jboss安装目录下:\jboss-4.2\server\default\deploy\ejb3.deployer),

可以使用@LocalBinding和@RemoteBinding注释,例如:

import javax.ejb.Stateful;
import org.jboss.annotation.ejb.RemoteBinding;

@Stateful
@RemoteBinding(jndiBinding = "javaee/RemoteVisitJndi")
public class VisitAccountJndi implements VisitAccountRemote {
	public void addUser() {
		Sysotem.out.println("增加");
	}
}
 

你可能感兴趣的:(jboss,ejb)