I have a Java application deployed on Websphere 8.5 as an EAR. I am trying to figure out how do a JNDI lookup from ejb-jar.xml. (Noob to EJB) I typically do JNDI entries lookup from the WAR by adding the entries in web.xml. Now working on a ejb module I figured out I can still do JNDI lookup at ejb bean[1]. See below my ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?><ejb-jar id="ejb-jar_ID" version="2.1"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>MyService-ejb</display-name>
<enterprise-beans>
<message-driven id="MyServiceSyncOutboundCom">
<ejb-name>MyServiceSyncOutboundcom</ejb-name>
<ejb-class>
com.company.MyService.sync.com.MyServiceSyncOutboundCom
</ejb-class>
<transaction-type>Container</transaction-type>
<message-destination-type>
javax.jms.Queue
</message-destination-type>
<env-entry>
<env-entry-name>minBalance</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>500</env-entry-value>
</env-entry>
<env-entry>
<description></description>
<env-entry-name>maxCreditBalance</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>10000</env-entry-value>
</env-entry>
</message-driven>
</enterprise-beans>
My question: How do I get these entries into my class now that I have no web.xml ?
Also if the ejb module comprises of a JAR dependency say myservice-config.jar
with a Configs
class, can I retrieve these entries in that class instead of my Message Driven Bean? How does that change the ejb-jar.xml
file then?
[1] https://docs.oracle.com/cd/E16439_01/doc.1013/e13981/servjndi008.htm