是否可以通过JMX获取ibm-ejb-jar-bnd.xmi等Websphere deploymentDescriptor?

时间:2014-08-25 17:09:33

标签: ejb websphere jndi jmx

我希望通过JMX从Websphere deploymentDescriptor获取EJB的jndi绑定名称。但是我只找到了getDeploymentDescriptor方法,它只能获取原始的ejb-jar.xml。是否可以通过JMX获取ibm-ejb-jar-bnd.xmi等Websphere deploymentDescriptor?或者其他一些方法也可以为EJB获取jndi名称

1 个答案:

答案 0 :(得分:0)

可以通过wsadmin命令。它会打印出以下信息:

wsadmin>print AdminApp.view('DefaultApplication#Increment.jar+META-INF/ejb-jar.xml', '-BindJndiForEJBNonMessageBinding')

BindJndiForEJBNonMessageBinding: Binding enterprise Bean to JNDI names

Each non-message-driven enterprise bean in your application or module must be bound 
to a Java Naming and Directory Interface (JNDI) name. For beans in a pre-EJB
 3.0 module, you have to use JNDI name for the bean to provide the binding. For
beans in a EJB 3.0 module, you can optionally provide binding through JNDI name
for the bean or local/remote home JNDI names. If JNDI name for the bean is specified,
you cannot specify binding for its local/remote home and any business interface. 
If no JNDI name is specified for beans in a EJB 3.0 module, runtime will
provide a container default.

Module:  Increment EJB module
Bean:  Increment
URI:  Increment.jar,META-INF/ejb-jar.xml
Target Resource JNDI Name:  Increment
Local Home JNDI Name:
Remote Home JNDI Name:

由于wsadmin使用的是JMX,你也应该能够找到所需的方法 您需要以编程方式阅读它并且不能依赖默认绑定的任何原因吗?