简体   繁体   English

是否可以在 WebSphere Liberty 中查询/浏览 JNDI 树?

[英]Is it possible to query/browse the JNDI tree in WebSphere Liberty?

I have a EJB with a remote interface that I want to access from a client.我有一个带有远程接口的 EJB,我想从客户端访问它。 I have difficulties to build the string for the JNDI lookup.我很难为 JNDI 查找构建字符串。 Is there a command line tool which shows all register enterprise beans in the naming service?是否有命令行工具显示命名服务中的所有注册企业 bean? Or can I see this in a log file?或者我可以在日志文件中看到这个吗?

The JNDI name should look like this: JNDI 名称应如下所示:

corbaname:localhost:2809#ejb/global/MyApp/MyModule/EJBName!full.package.remote.interface.Name corbaname:localhost:2809#ejb/global/MyApp/MyModule/EJBName!full.package.remote.interface.Name

I'm also not really sure if my app and module name in the string is correct.我也不确定字符串中的应用程序和模块名称是否正确。

As far as I know there is no way to dump the JNDI namespace on WebSphere Liberty ( there is a way to do this in WebSphere traditional ).据我所知,没有办法在 WebSphere Liberty 上转储 JNDI 命名空间( 在 WebSphere 传统中有一种方法可以做到这一点)。

The easiest way to check what JNDI name your EJBs are registered at, is to check the messages.log file.检查 EJB 注册的 JNDI 名称的最简单方法是检查 messages.log 文件。 In the messages.log file you should see some CNTR0167I messages which indicate where the server has bound your EJBs.在messages.log 文件中,您应该会看到一些CNTR0167I消息,这些消息指示服务器已绑定您的EJB 的位置。 The messages.log file can be found in ${server.config.dir}/logs/messages.log .可以在${server.config.dir}/logs/messages.log找到 messages.log 文件。

Example EJB binding message: EJB 绑定消息示例:

CNTR0167I: The server is binding the com.example.DatabaseBean interface of the DatabaseBean enterprise bean in the TestProject.war module of the TestProject application. CNTR0167I: 服务器正在绑定TestProject 应用程序的TestProject.war 模块中DatabaseBean 企业bean 的com.example.DatabaseBean 接口。 The binding location is: java:global/TestProject/DatabaseBean!com.example.DatabaseBean绑定位置为: java:global/TestProject/DatabaseBean!com.example.DatabaseBean

For more info, check out the IBM doc:有关更多信息,请查看 IBM 文档:
Using enterprise JavaBeans with remote interfaces on Liberty 在 Liberty 上使用具有远程接口的企业 JavaBean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM