1

I have a problem while trying to call my ejb3 existing in JBoss 7 module from my war file. Please have a look on following details-

Here is Local interface-

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
    }
}

both interface and bean are in side the jboss as 7 module (JBOSS_HOME/modules/com.xxx.switch.main) within Switch.jar.

Now my problem is, I am trying to call it from a war (SwitchMain.war) but getting following exception-

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.

Please help me to solve this issue.

Thanks in advance.

4

1 回答 1

0

您可以尝试通过在 bean 类中添加@LocalBinding(jndiBinding = “CSTimerBean “)来定义自己的接口 。请参阅此链接以验证您如何调用接口,这可能是您调用http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/JNDI_Bindings.html的方式的问题

于 2013-04-25T08:31:14.407 回答