Descripteur de déploiement
Bonjour,
j'ai crée un EJB a parti de RAD (Eclipse + Websphère) celui-ci me génére à la volée mon descriptuer de déploiement mais celui-ci ne marche uniquement pour le remote et non pour le local.
Code:
1 2 3 4 5 6 7 8 9 10 11
|
<session id="GestionCacheEJB">
<ejb-name>GestionCacheEJB</ejb-name>
<home>com.vignette.ejb.cache.GestionCacheEJBHome</home>
<remote>com.vignette.ejb.cache.GestionCacheEJB</remote>
<local-home>com.vignette.ejb.cache.GestionCacheEJBLocalHome</local-home>
<local>com.vignette.ejb.cache.GestionCacheEJBLocal</local>
<ejb-class>com.vignette.ejb.cache.GestionCacheEJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session> |
Et celui-ci ne me propose qu'un JNDI associé à mon interface remote.
j'ai lu dans un bouquin qu'on spécifier d'autre élément dans le descripteur de déploiment tel que :
Code:
1 2 3 4 5 6 7 8
|
<ejb-local-ref>
<description>toto</description>
<ejb-ref-name>ejb/GestionCache</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.vignette.ejb.cache.GestionCacheEJBLocalHome</local-home>
<local>com.vignette.ejb.cache.GestionCacheEJBLocal</local>
</ejb-local-ref> |
pour ce qui est de l'appel au niveau de mon code je pense que c'est Ok.
Code:
1 2 3 4 5 6 7 8 9 10
|
//remote
Object objref =
initialContext.lookup("ejb/com/vignette/ejb/cache/GestionCacheEJBHome");
GestionCacheEJBHome homeDistant =
(GestionCacheEJBHome) PortableRemoteObject.narrow(objref,GestionCacheEJBHome.class);
//local
GestionCacheEJBLocalHome homeLocal =
(GestionCacheEJBLocalHome)initialContext.lookup("ejb/com/vignette/ejb/cache/GestionCacheEJBLocalHome"); |
dois-je utiliser <ejb-local-ref> ?
pour l'appel distant comme je disais aucun soucis mais pour l'appel en local, j'ai l'erreur suivante javax.naming.NameNotFoundException