EJB HelloWorld小例子报错

普通java类客户端访问EJB SessionBean总是显示Connection refused
我用的是JBoss7.1.1 + Myeclipse10 + EJB3.0 +jdk1.7

会话bean代码:
package com.service;

import javax.ejb.Remote;

@Remote
public interface HelloWorldBeanRemote {
public String sayHello(String name);
}

package com.service;

import javax.ejb.Stateless;

@Stateless
public class HelloWorldBean implements HelloWorldBeanRemote {

@Override
public String sayHello(String name) {
    // TODO Auto-generated method stub
    return name+",Hello World";
}

}

java客户端代码:
import java.util.Properties;

import javax.naming.InitialContext;

import com.service.HelloWorldBean;

public class test {

/**
 * @param args
 */
public static void main(String[] args) {
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
    props.setProperty("java.naming.provider.url","localhost:4447");
    props.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
    try{
        InitialContext ctx = new InitialContext(props);
        HelloWorldBean helloworld = (HelloWorldBean) ctx.lookup("HelloWorldBean/remote");
        System.out.println(helloworld.sayHello("Jhon"));
    }catch(Exception e){
        System.out.println(e.getMessage());
    }
}

}

客户端我BuildPath里添加了EJB的接口,还添加了jboss-client.jar,jnp-client.jar,jbossall-client.jar

请大神指点一下,挺急的谢谢!在线等!

你既然是用 HelloWorldBeanRemote接口,为什么实现的时候是 HelloWorldBean呢?你这样注解岂不是无效了

我把HelloWorldBean helloworld = (HelloWorldBean) ctx.lookup("HelloWorldRemote/remote");改着这个了,结果报
11:33:16,050 ERROR org.jboss.remoting.remote.connection JBREM000200: Remote connection failed: java.io.IOException: 远程主机强迫关闭了一个现有的连接。
这样的错