呼叫成功后,远程ejb呼叫失败

时间:2013-08-01 22:38:38

标签: ejb jboss7.x ejb-3.1

我有一个奇怪的问题。 我已经安装了JbossAS 7.1.1并成功部署了我的ear文件。

我的客户端正在运行到tomcat 6.035。

我可以对我的jboss部署进行成功的EJB调用 - 但是一个特定的EJB调用失败了。

我的客户端环境设置如下: -

  Hashtable<String, String> env = new Hashtable<String, String>();

  env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");
  env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
  env.put(Context.PROVIDER_URL, "remote://localhost:4447");
  env.put(Context.SECURITY_PRINCIPAL, "abc");
  env.put(Context.SECURITY_CREDENTIALS, "123");
  env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
  env.put("jboss.naming.client.ejb.context", "true");

  env.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
  env.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
  //env.put("remote.connection.x1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

  logger.debug("Added security ");

  try {
    ctx = new InitialContext(env);
  } catch (NamingException e) {
    logger.error("Can't get initial context.");
    e.printStackTrace();
  }

stracktrace非常奇怪。它寻找RemoteNamingEJBClient 请帮忙 - 我不在乎。

  18:03:25,541 WARN  [org.jboss.modules] (EJB default - 8) Failed to define class org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector in Module "org.jboss.remote-naming:main" from local module loader @50988 (roots:  jbossAS7/modules): java.lang.LinkageError: Failed to link org/jboss/naming/remote/client/ejb/RemoteNamingEjbClientContextSelector (Module "org.jboss.remote-naming:main" from local module loader @50988 (roots: jbossAS7/modules))


  Caused by: java.lang.NoClassDefFoundError: org/jboss/ejb/client/ContextSelector


  Caused by: java.lang.ClassNotFoundException: org.jboss.ejb.client.ContextSelector from [Module "org.jboss.remote-naming:main" from local module loader

1 个答案:

答案 0 :(得分:1)

我通过添加

解决了这个问题

远程命名模块中的ejb-client模块

此问题在此处进行了跟踪 -

https://issues.jboss.org/browse/AS7-4872

<resources>
    <resource-root path="jboss-remote-naming-1.0.2.Final.jar"/>
    <!-- Insert resources here -->
</resources>

<dependencies>
    <module name="javax.api"/>
    <module name="org.jboss.ejb-client" />
    <module name="org.jboss.remoting3"/>
    <module name="org.jboss.logging"/>
    <module name="org.jboss.marshalling"/>
    <module name="org.jboss.marshalling.river"/>
</dependencies>

相关问题