Alexey
Alexey

Reputation: 2582

How to change EJB JNDI bindings in WebSphere Liberty

I have an ear application which is deployed to WebSphere Liberty 8.5. The application includes an EJB module in which I declared a few EJBs. My EJBs are declared in the following way:

public interface MyEjb...

@Local
public interface MyEjbLocal extends MyEjb...

@Remote
public interface MyEjbRemote extends MyEjb...

@Stateless
public class MyEjbBean implements MyEjbLocal, MyEjbRemote...

When application starts I can see in WebSphere Liberty log that this EJB gets the following JNDI names:

java:global/my-ear-app-name/my-ejb-module-name/MyEjbBean!my.package.name.MyEjbLocal,
java:global/my-ear-app-name/my-ejb-module-name/MyEjbBean!my.package.name.MyEjbRemote

I need to change these names. If I understand it correctly, it can be done in the ibm-ejb-jar-bnd.xml file. I have an ibm-ejb-jar-bnd.xml file in the META-INF directory of my EJB module jar file. This file contains the following configuration:

<session name="MyEjbBean" simple-binding-name="my/new/jndi/name"></session>

However, this configuration does not have any effect: when I start the ear application I still see the default JNDI bindings in the log.

I know that ibm-ejb-jar-bnd.xml is picked up correctly by WebSphere Liberty, because when I specify a wrong bean name in the <session> tag, I get a warning in WebSphere log.

How can I change EJB JNDI bindings in WebSphere Liberty?

Upvotes: 2

Views: 2663

Answers (1)

M. Tamboli
M. Tamboli

Reputation: 386

My understanding is that the simple-binding-name is ignored in ibm-ejb-jar-bnd.xml files for WebSphere Liberty.

It is mentioned in below doc (search for "simple-binding"): http://www.ibm.com/support/knowledgecenter/SSAW57_liberty/com.ibm.websphere.wlp.nd.doc/ae/rwlp_restrict.html

Upvotes: 2

Related Questions