请教,一个怪异的EJB3问题
EJB接口:
public interface IBackServiceBean
{
public boolean backMsgBySync(Map msgMap);
}
Remote接口:
@Remote
@Clustered
public interface IBackServiceBeanRemote extends IBackServiceBean
{
}
集群接口:
public @interface Clustered
{
Class loadBalancePolicy() default RoundRobin.class;
String partition() default "test";
}
Bean:
@Stateless
@Clustered
public class BackServiceBean implements IBackServiceBeanRemote
{
public boolean backMsgBySync(Map msgMap)
{
......
}
}
部署在JBoss4.2.3中,从控制台上面看到有以下JNDI
+- BackServiceBean (class: org.jnp.interfaces.NamingContext)
| +- remote (proxy: $Proxy72 implements interface com.a8.service.back.ejb.IBackServiceBeanRemote,interface org.jboss.ejb3.JBossProxy)
日志中有:
2008-09-04 09:33:46,484 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: com.service.back.ejb.BackServiceBean ejbName: BackServiceBean
jndi.properties:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=jboss.naming:org.jnp.interfaces
jnp.partitionName=test
客户端调用:
public class EjbServiceImpl implements IEjbService
{
private static final String EJBNAME = "BackServiceBean/remote";
private void init()
{
try
{
Properties prop = new Properties();
ctx = new InitialContext(prop);
IBackServiceBean iback = (IBackServiceBean) ctx.lookup(EJBNAME);
}
......
}
}
报错:
javax.naming.NameNotFoundException: BackServiceBean/remote
at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:223)
at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
找不到这个EJB接口,请问什么原因啊
我觉得没写错啊,烦死了
谢谢