Java Tutorial - Java Scipt : The JBoss.xml File

Java Tutorial - Java Scipt :

The JBoss.xml File


JNDI is used to retrieve home and LocalHome interfaces from the EJB container. The jboss.xml file tells the JBoss container how to assign JNDI names to the interfaces. The following code shows the entire jboss.xml file for our
current example:

<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE jboss PUBLIC
“-//JBoss//DTD JBOSS//EN”
‘file://C:\openjava\jboss-3.0.6_tomcat-4.1.18\docs\dtd\jboss_3_0.dtd’>
<jboss>
<enterprise-beans>
<entity>
<ejb-name>UserEJB</ejb-name>
<jndi-name>ejb/UserEJB</jndi-name>
<local-jndi-name>ejb/LocalUserEJB</local-jndi-name>
</entity>
</enterprise-beans>
</jboss>

An entry should exist in this file for each bean to be deployed. The <ejbname> corresponds to the <ejb-name> that appears in the ejb-jar.xml file. The <jndi-name> provides the JNDI name that will be used to retrieve the home interface. The <local-jndi-name> provides the JNDI name that will be used to retrieve the LocalHome interface.