Stateful Bean Create函数的参数问题

superxiaomm superxiaomm 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
一直报错,部署不上去.

In EJB My, the local home create method ejbCreate() did not have a corresponding ejbCreate method in the bean class, or the ejbCreate method in the bean class was not public.

Unable to deploy EJB: test.jar from test.jar:


In EJB My, the local home create method ejbCreate() did not have a corresponding ejbCreate method in the bean class, or the ejbCreate method in the bean class was not public.

我是这样作的.
bean里面,加入了一个
public void ejbCreate(int val) {
this.val = val;
}
也保留了public void ejbCreate(){}

为了加参数,我把bean的构照函数也加了一个,这个不知道需要嘛??
public MyBean(int val) {}
public MyBean() {}

在Home接口中
public test.My create(int val)
throws javax.ejb.CreateException,java.rmi.RemoteException;

public test.My create()
throws javax.ejb.CreateException,java.rmi.RemoteException;

由于前面报错,所以在local home中这样写:
public test.MyLocal create(int val)
throws javax.ejb.CreateException;
public test.MyLocal create()
throws javax.ejb.CreateException;
我不用local home的,真不知道为什么会报错

能不能帮我看看,哪里错了???实在想不出了.......5555555555
...全文
评论 2
收藏 已收藏
分享
返回顶部
superxiaomm
Java EE 67,535 成员 225,843 内容