解决部署EJB出现的异常:Local and Remote Interfaces cannot have duplicate interface for ...
程序员文章站
2022-03-11 08:34:40
...
部署EJB出现的异常:Local and Remote Interfaces cannot have duplicate interface for ...
在编写EJB实现类是,如果同时在一个实现类里声明远程接口与本地接口时,需要指定其接口的类型:
例如:
package com.ejb.jboss.dao.impl;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import com.ejb.jboss.bean.User;
import com.ejb.jboss.dao.UserManager;
@Stateless
@Remote(UserDAO.class)
@Local(UserDAO.class)
public class UserManagerBean implements UserManager {
public void addUser(User user) {
System.out.println("保存");
}
}