Local and Remote Interfaces cannot have duplicate interface for bean UserManagerBean错误
2009-01-16 20:34
405 查看
解决:http://www.blogjava.net/Bobbyliao/archive/2008/10/01/232018.html
后来发现,原来是UserManagerBean中的@Local,@Remote必须明确写上接口的类型,才可以。修改代码如下:
package cn.study.ejb;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless
@Remote(UserManager.class)
@Local(UserManager.class)
public class UserManagerBean implements UserManager
public void addUser(User user) System.out.println(user.getUsername() + "已经被成功保存!");
user.setId(13);
}
}
后来发现,原来是UserManagerBean中的@Local,@Remote必须明确写上接口的类型,才可以。修改代码如下:
package cn.study.ejb;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless
@Remote(UserManager.class)
@Local(UserManager.class)
public class UserManagerBean implements UserManager
public void addUser(User user) System.out.println(user.getUsername() + "已经被成功保存!");
user.setId(13);
}
}
相关文章推荐
- Local and Remote Interfaces cannot have duplicate interface for bean UserManagerBean错误
- EJB3.0异常总结---javax.ejb.EJBException: Local and Remote Interfaces cannot have duplicate interface for
- cyrus-and/chrome-remote-interface: Chrome Debugging Protocol interface for Node.js
- Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly
- postfix报错postfix: fatal: parameter inet_interfaces: no local interface found for ::1
- send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
- 解决send-mail: fatal: parameter inet_interfaces: no local interface found for ::1 没有本地接口发现::1
- How to set up ADB for remote machine development and local device deployment
- My Holder interface for bean and set management
- send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
- postfix报错postfix: fatal: parameter inet_interfaces: no local interface found for ::1
- 用于远程教育和培训的ROS机器人在线编程(ROS-based Online Robot Programming for Remote Education and Training)
- one or morebreakpoints cannot be set and have been disabled解决方案
- eclipse中出现Cannot bind to local 8601 for debugger解决方法
- Cannot connect to WMI provider.You do not have permission or the server is unreachable.Note that you can only manager SQL Server 2005 and later version with SQL Server Configuration Manager.Invalid namespace [0x8004100e]
- vc不能debug,提示One or morebreakpoints cannot be set and have been disabled。。。。。
- Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
- No RSA host key is known for had-0 and you have requested strict checking.
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
- Cannot find interface declarartion for 'nsobject' & Unknow type name 'NSString'