-
I am developing an ejb application that requires dependent object.For this i have to use <dependents> and <dependent> tag in my ejb-jar file.But when i use ejbc command i get error message element dependents not found in dtd or schema.
-
Sanjay,
Below you can find an excerpt from an example descriptor file (ejb-jar.xml).
In the example below I have a FacadeBean handling all calls to the application and routing to the underlying beans.
My FacadeBean, in this example, has a reference to another stateless session bean, namely MyBeanSession.
What you need to make sure is that you specify all beans you want to reference in the <ejb-ref> part, but you also must specify the referenced beans explicitly (see MyBeanSession).
<ejb-jar>
...
<!-- FacadeBean -->
<session>
<ejb-name>FacadeBean</ejb-name>
<home>com.henkee.ejb.facade.FacadeHome</home>
<remote>com.henkee.ejb.facade.FondaFacade</remote>
<ejb-class>com.henkee.ejb.facade.FondaFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/MyBeanSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.henkee.ejb.MyBeanSessionHome</home>
<remote>com.henkee.ejb.MyBeanSession</remote>
<ejb-link>MyBeanSession</ejb-link>
</ejb-ref>
</session>
<!-- MyBeanSession -->
<session>
<ejb-name>MyBeanSession</ejb-name>
<home>com.henkee.ejb.MyBeanSessionHome</home>
<remote>com.henkee.ejb.MyBeanSession</remote>
<ejb-class>com.henkee.ejb.MyBeanSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</ejb-jar>
Hope this helps
Regards
/Henrik