プロジェクト内に 2 つのモジュールがあります。
JBoss 6 サーバー:
import javax.ejb.*;
@Remote
public interface srv_interface {
public int test();
}
@Stateless
public class srv_class implements srv_interface {
public int test()
{
return 999;
}
}
クライアント:
public class Main
{
public static void main( String[] arg ) throws Exception
{
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.setProperty("java.naming.provider.url", "jnp://127.0.0.1:1099");
Context context = new InitialContext(props);
Object connectionFacadeRemote = context.lookup("srv_class/remote");
srv_interface exampleService = (srv_interface) connectionFacadeRemote; // can't get srv_interface anywhere...
}
}
問題は、クライアントが srv_interface を認識しないことです。クライアントモジュールの 'srv_interface' を見えるようにする方法は?