【问题标题】:ejb3 access in out of container way容器外方式的ejb3访问
【发布时间】:2012-03-04 09:06:24
【问题描述】:

我在动作代码示例中深入研究 ejb,并坚持从 jboss 容器中访问 ejb3。 我在 jboss 6.1.0 上部署了 2 个会话 bean,我从服务器日志中看到:ebj bean 绑定到全局 jndi(java:global/?)。所以我有运行客户端,它使用 jndi.properties 文件创建初始上下文:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=127.0.0.1:1098

我的客户端代码如下所示: ... 上下文上下文 = new InitialContext(); 对象存根 = context.lookup("chapter2/PlaceOrderBean/remote"); ... 我收到了错误:

Caused by: javax.naming.NameNotFoundException: ProxyFactory not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:399)

我认为 jboss6 支持远程 ejb 的 rmi 和 iiop-rmi 协议。但我只体验过 websphere 10。感谢您的帮助和建议。

【问题讨论】:

    标签: jboss ejb-3.0


    【解决方案1】:

    对不起,我自己找到了答案。 它可能对某人有帮助。 首先我使用了 jboss 社区版本,最后一次我使用生产版本进行了示例:jboss 5.1.0 GA。上帝保佑!效果很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多