session facade bean and local name binding
ionel Apr 29, 2002 3:46 AMhi,
I'm trying to develop a session bean facade to hide some CMP beans from the outside.
These CMP's are only defined with local intefaces.
The SLSB has a remote inteface and is trying to connect the CMP throught their local inteface but it seems like the name binding fails.
I've found informations about the <ejb-ref> or <ejb-local-ref> tagsfor the session bean definition in ejb-jar.xml but each definitions is different from the other so I can't figure out which is the good one (even if I've tried them both)
I also wonder which tag to put in the jboss.xml file. Do my CMP beans have to be declared with a <jndi-name> or a <jndi-local-name> tag ?
Last point : when deploying the .jar file with a <ejb-ref> defined in the ejb-jar.xml file, no "nickname binding" is created for the CMP as almost all docs say.
DOCS USED :
- "Rules and Patterns for Session Facades" - Kyles Brown - (c) IBM
- "Mastering EJB II" - Ed Roman
- Differents EJB/Java forums
Thanks for any help,
ionel
here are my description files :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<display-name>personneBean</display-name>
<ejb-name>personneBean</ejb-name>
<local-home>personne.personneLocalHome</local-home>
personne.personneLocal
<ejb-class>personne.personneBean</ejb-class>
<persistence-type>Container</persistence-type>
<!-- <prim-key-class>personne.personnePK</prim-key-class> -->
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>personneBean</abstract-schema-name>
<cmp-field>
id organisme dont depend la personne
<field-name>organisme</field-name>
</cmp-field>
<cmp-field>
heure d envoi du mail
<field-name>heureMail</field-name>
</cmp-field>
<cmp-field>
heure de fin de travail
<field-name>heureFin</field-name>
</cmp-field>
<cmp-field>
heure du debut de travail
<field-name>heureDeb</field-name>
</cmp-field>
<cmp-field>
adresse email ou contacter la personne
<field-name>mail</field-name>
</cmp-field>
<cmp-field>
nom de la personne
<field-name>nom</field-name>
</cmp-field>
<cmp-field>
numero de tel ou l on peut joindre la personne
<field-name>numtel</field-name>
</cmp-field>
<cmp-field>
prenom de la personne
<field-name>prenom</field-name>
</cmp-field>
<cmp-field>
id unique de la personne
<field-name>id</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<security-identity>
<use-caller-identity></use-caller-identity>
</security-identity>
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select distinct object(p) from personneBean p where p.nom=?1</ejb-ql>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>select distinct object(p) from personneBean p</ejb-ql>
<display-name>organismeBean</display-name>
<ejb-name>organismeBean</ejb-name>
<local-home>organisme.organismeLocalHome</local-home>
organisme.organismeLocal
<ejb-class>organisme.organismeBean</ejb-class>
<persistence-type>Container</persistence-type>
<!-- <prim-key-class>organisme.organismePK</prim-key-class> -->
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>organismeBean</abstract-schema-name>
<cmp-field>
nom de l organisme
<field-name>nom</field-name>
</cmp-field>
<cmp-field>
mail de l organisme
<field-name>mail</field-name>
</cmp-field>
<cmp-field>
url du site de l entreprise
<field-name>url</field-name>
</cmp-field>
<cmp-field>
adresse du siege de l entreprise
<field-name>adresse</field-name>
</cmp-field>
<cmp-field>
numero de tel du standard de l entreprise
<field-name>numtel</field-name>
</cmp-field>
<cmp-field>
id unique de l entreprise
<field-name>id</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<security-identity>
<use-caller-identity></use-caller-identity>
</security-identity>
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select distinct object(o) from organismeBean o where o.nom=?1</ejb-ql>
<display-name>calendrierBean</display-name>
<ejb-name>calendrierBean</ejb-name>
calendrier.calendrierHome
calendrier.calendrier
<ejb-class>calendrier.calendrierBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejbcal/PersonneRef</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>personne.personneLocalHome</local-home>
personne.personneLocal
<ejb-link>personneBean</ejb-link>
</ejb-local-ref>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>personneBean</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<ejb-name>organismeBean</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
<?xml version="1.0"?>
<enterprise-beans>
<ejb-name>calendrierBean</ejb-name>
<jndi-name>ejbcal/Calendrier</jndi-name>
<ejb-name>personneBean</ejb-name>
<local-jndi-name>ejbcal/LocalPersonne</local-jndi-name>
<ejb-name>organismeBean</ejb-name>
<local-jndi-name>ejbcal/LocalOrganisme</local-jndi-name>
</enterprise-beans>