我在JBoss上部署了EJB,我想从Websphere中查找它。我使用maven来管理我的项目。这是我使用来查找EJB从Websphere部署在JBoss上的远程查找EJB
Properties props = new Properties();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
props.put(Context.PROVIDER_URL, "remote://192.168.0.11:4447");
props.put(Context.SECURITY_PRINCIPAL, "user");
props.put(Context.SECURITY_CREDENTIALS, "pass");
props.put("jboss.naming.client.ejb.context", true);
InitialContext ctx = new InitialContext(props);
return (IEjbInterface) ctx.lookup("my-ear/my-app/MyClass!my.class.interfaces.IEjbInterface");
我已经添加了以下相关的查找
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<type>pom</type>
<version>7.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jms-client-bom</artifactId>
<type>pom</type>
<version>7.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-naming</artifactId>
<version>7.1.1.Final</version>
</dependency>
此代码从一个独立的应用程序工作的代码,但包裹在战争时被部署在WebSphere上查找抛出以下异常
java.lang.ClassNotFoundException: org.xnio.BrokenPipeException