我正在尝试调用部署在远程服务器上的无状态 EJB。我可以从本地 JBoss 环境调用 bean,但是当我更改remote.connection.default.host
为远程机器的主机时,我的客户端代码不起作用。
这是我的jboss-ejb-client.properties
:
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=SERVERIP/HOSTNAME
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=username
remote.connection.default.password=Password
我的客户端代码如下所示:
Properties properties = new Properties();
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
String jndi = "jndi_name";
Context context = new InitialContext(properties);
obj = context.lookup(jndi);
请帮忙。
谢谢大家。杰克。