我在从war文件调用JBoss 7模块中的现有ejb3时遇到问题。请看一下以下详情:
这是本地接口-
package com.uniteller.switchcore.cs.iface;
import javax.ejb.Local;
import javax.ejb.Remote;
@Local
public interface CSTimer {
public boolean init( );
}
EJB:
package com.uniteller.switchcore.cs.impl;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless
@LocalBean
public class CSTimerBean implements CSTimer {
public CSTimerBean() {
// TODO Auto-generated constructor stub
}
@Override
public boolean init() {
//Some log statements
}
}
接口和bean都在Switch.jar中的jboss as7模块(JBOSS_HOME/modules/com.xxx.switch.main)中。
现在我的问题是,我试图从一场战争(SwitchMain.war)中调用它,但得到了以下异常-
12:50:41,593 ERROR [stderr] (MSC service thread 1-4) javax.naming.NameNotFoundException: ejb:/UFSwitch/CSTimerBean!com.uniteller.switchcore.cs.iface.CSTimer -- service jboss.naming.
请帮我解决这个问题。
提前谢谢。
发布于 2013-04-25 16:31:14
您是否可以尝试通过在bean类中添加@LocalBinding(jndiBinding =“CSTimerBean”)来定义自己的接口。请参阅此链接以验证您调用接口的方式,这可能是您调用http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/JNDI_Bindings.html的方式存在问题
https://stackoverflow.com/questions/16209223
复制相似问题