@Local注释和@Remote注释不能一起使用
来源:互联网 发布:热血传奇装备数据库 编辑:程序博客网 时间:2024/05/10 12:05
EJB @Local注释和@Remote注释不能一起使用 :Remote和Local方式写在同一个类上,在部署到jboss4.0可以,jboss5.0报错
在4.X版本上就可以同时写在一个类上,代码如下:
public interface UserManager {public void save(UserTest user);}@Stateless@Remote@Localpublic class UserManagerBean implements UserManager, UserManagerLocal{public void save(UserTest user) {System.out.println("User[username=" + user.getUsername() +"]已保存");user.setId(1);}}
5.0版本就不行,报错如下:
Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible:stream classdesc serialVersionUID = -3758782076801249473, local classserialVersionUID = 337700910587744646
DEPLOYMENTS IN ERROR:
Deployment"vfsfile:/E:/javaprogram/jboss-5.0.1.GA/server/default/deploy/ejb_03.jar/"is in error due to the following reason(s):javax.ejb.EJBException: Cannot designateboth javax.ejb.Local and javax.ejb.Remote annotations without 'value' attributeon UserManagerBean. [EJBTHREE-1025]
问题具体描述及解决:
http://topic.csdn.net/u/20090202/20/b888766f-5fd4-40a3-b886-bd1e04c6f758.html
jboss4.x版本可以一个接口定义为remote和local两种方式,jboss5.0版本的则需要定义两个接口,并明确写明(当然具体实现的方式有多种):代码如下:
- public interface UserManager {
- public void save(UserTest user);
- }
- public interface UserManagerLocal {
- public void save(UserTest user);
- }
- @Stateless
- @Remote({UserManager.class})
- @Local({UserManagerLocal.class})
- public class UserManagerBeanimplements UserManager, UserManagerLocal{
- public void save(UserTest user) {
- System.out.println("User[username=" + user.getUsername() +"]已保存" );
- user.setId(1);
- }
- }
- @Local注释和@Remote注释不能一起使用
- @Local注释和@Remote注释不能一起使用
- Xcode8注释快捷键不能使用
- Xcode8 注释快捷键不能使用解决办法
- 关于Xcode注释不能使用问题
- HTML <!--...--> 注释 、CSS/JS //注释 和 /*.....*/ 注释
- local和remote的区别
- local和remote的区别
- remote和local 的区别
- <!-- -->注释和<%-- --%>注释的区别
- Java注释和注释模板
- jsp注释和html注释
- Java注释和注释模板
- 注释
- 注释
- 注释
- 注释
- 注释
- 【解题报告】POJ 3270 Cow 置换群基础 -- 轮换
- 【原】常见CSS3属性对ios&android&winphone的支持
- C语言生产者与消费者-随机数实现
- nodejs+express+socketio实现即时聊天系统初体验
- Unity3d Transform.DetachChildren使用
- @Local注释和@Remote注释不能一起使用
- hdu 1505 City Game (hdu 1506的升级版)
- HDU 4565 So Easy!
- 模仿360安全卫士玻璃按钮控件
- 别拿项目经理不当干部[适用于基层经理]
- 今天才知道我喜欢恶作剧
- 从入侵角度浅谈服务器该做的防护和检查工作
- 加入收藏、设为首页代码,兼容360/火狐/谷歌/IE等主流浏览器
- C语言生产者与消费者-不同速率实现