我有两个Jboss 5服务器实例,每个实例都部署了两个EAR文件,分别是Client.Ear和Server.Ear。
Server Ear暴露了一些EJB。我想通过注释将其注入到ClientEar中。使用JNDI查找,我做得很好,而且它也可以工作。但是使用注释时,我总是得到javax.naming.NamingException。
然而,在跨部署工件注入会话bean时,必须使用全局JNDI名称进行注入,我也像这样使用:
@EJB(mappedName ="java:global/Server/component/ApplicationService!com.test.server.ApplicationServiceInterface")
但似乎我没有为远程服务器提供provider_url以绑定客户端ear实例。 如何使用注释@EJB配置JNDI属性,即provider_url,initial context properties?
但似乎我没有为远程服务器提供provider_url以绑定客户端ear实例。 如何使用注释@EJB配置JNDI属性,即provider_url,initial context properties?
jboss-ejb-client.properties
文件放置在您的根源文件夹下。这里有一个示例文件:https://github.com/akquinet/jbosscc-wildfly-examples/blob/master/ejb-remote-example/ejb-remote-example-ejb-client/src/main/resources/jboss-ejb-client.properties - gmazlami