在独立模式的 JBoss 7.1.1 中,所有 JNDI 绑定(bind)都在 jboss:domain:naming:1.1 子系统的standalone.xml 文件中配置。根据文档,standalone.xml 在服务器运行时无法修改。我尝试使用 JBoss CLI,但我不知道如何编写/修改资源。
如何在不重新启动 jboss 的情况下更改 JNDI 中的值?
最佳答案
应该帮助你:https://docs.jboss.org/author/display/AS71/JNDI+Reference
主题 - 将条目绑定(bind)到 JNDI:
An example standalone.xml might look like:
<subsystem xmlns="urn:jboss:domain:naming:1.1" > <bindings> <simple name="java:global/a" value="100" type="int" /> <object-factory name="java:global/b" module="com.acme" class="org.acme.MyObjectFactory" /> <lookup name="java:global/c" lookup="java:global/b" /> </bindings> </subsystem>
To add these entries via the CLI:/subsystem=naming/binding=java\:global\/mybinding:add(binding-type=simple, type=long, value=1000)
To see all all options that are taken by the add command (this can actually be used to get the description of any CLI command):/subsystem=naming/binding=*:read-operation-description(name=add)
没试过,但我希望这会有所帮助!
关于wildfly - JBoss 7.1.1 在运行时更改 JNDI 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10811347/