1
votes

I hope to get jndi binding name for EJBs from Websphere deploymentDescriptor via JMX. But I only found the method getDeploymentDescriptor which can only get the original ejb-jar.xml.Is it possible to get Websphere deploymentDescriptor like ibm-ejb-jar-bnd.xmi via JMX? Or some other method which can get jndi name for EJBs as well

1

1 Answers

0
votes

It is possible via wsadmin command. It will print you following information:

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:

Since wsadmin is using JMX you should be able to find required methods there also.
Any reason why you need to read it programatically and cannot rely on default bindings?