IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java EE Discussion :

Getting "No EJB receiver available for handling [appName:,modulename:EJB3TimerService,distinctname:]


Sujet :

Java EE

  1. #1
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2015
    Messages : 7
    Points : 3
    Points
    3
    Par défaut Getting "No EJB receiver available for handling [appName:,modulename:EJB3TimerService,distinctname:]
    Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:HotelEAR,modulename:Gestion_Hotel,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@29770daa
    at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
    at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
    at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
    at com.sun.proxy.$Proxy0.addHotel(Unknown Source)
    at main.main(main.java:51)

    Pourriez vous s'il vous plait m'aider

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    tu peux afficher ton code? Cet EJB existe bien sur le serveur que tu veux atteindre, il est bien marqué "remote" ?

  3. #3
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2015
    Messages : 7
    Points : 3
    Points
    3
    Par défaut
    package metier.session;
    import java.util.List;

    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;

    import metier.entities.hotel;
    import metier.entities.reservation;
    @Stateless

    public class HotelEJBImpl implements IHotelLocal{
    @PersistenceContext(unitName="UP_bdhotel")
    private EntityManager em;
    @Override
    public void addReservation(reservation r){
    em.persist(r);
    }
    @Override
    public List<reservation> consulterReservations(){
    Query req=em.createQuery("select r from reservation r");
    return req.getResultList();
    }
    @Override
    public reservation consulterReservation(Long codeRes){
    reservation res=em.find(reservation.class, codeRes);
    if(res==null)throw new RuntimeException("Reservation Introuvable");
    return res;
    }
    @Override
    public void majReservation(reservation r){
    em.merge(r);
    }
    @Override
    public void supprimerReservation(Long codeRes){
    reservation res=consulterReservation(codeRes);
    em.remove(codeRes);
    }


    @Override
    public void addHotel(hotel h){
    em.persist(h);
    }
    @Override
    public List<hotel> consulterHotels(){
    Query req=em.createQuery("select h from hotel h");
    return req.getResultList();
    }
    @Override
    public List<hotel> consulterHotels(String nom){
    Query req=em.createQuery("select h from hotel h where h.nom like "+nom+" or h.ville like "+nom);
    return req.getResultList();
    }
    @Override
    public hotel consulterHotel(Long codeHotel){
    hotel res=em.find(hotel.class, codeHotel);
    if(res==null)throw new RuntimeException("Hotel Introuvable");
    return res;
    }
    @Override
    public void majHotel(hotel h){
    em.merge(h);
    }
    @Override
    public void supprimerHotel(Long codeHotel){
    hotel res=consulterHotel(codeHotel);
    em.remove(codeHotel);
    }
    @Override
    public boolean rechercher(String login,String mdp){
    boolean verif=true;

    return verif;
    }


    }

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Il manque un @remote pour permettre l'accès à distance à ton ejb. Pour le moment il est local.

  5. #5
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2015
    Messages : 7
    Points : 3
    Points
    3
    Par défaut
    le @ remote je l'ai mis dans la declaration de l'interface

    package metier.session;

    import java.util.List;

    import javax.ejb.Local;
    import javax.ejb.Remote;

    import metier.entities.hotel;
    import metier.entities.reservation;
    @Remote
    public interface IHotelLocal {

    public void addReservation(reservation r);
    public List<reservation> consulterReservations();
    public reservation consulterReservation(Long codeRes);
    public void majReservation(reservation r);
    public void supprimerReservation(Long codeRes);
    public boolean rechercher(String login,String mdp);

    public void addHotel(hotel h);
    public List<hotel> consulterHotels();
    public List<hotel> consulterHotels(String nom);
    public hotel consulterHotel(Long codeHotel);
    public void majHotel(hotel h);
    public void supprimerHotel(Long codeHotel);

    }

  6. #6
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2015
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2015
    Messages : 7
    Points : 3
    Points
    3
    Par défaut
    Je pense que le probléme est à ce niveau

    import java.util.Hashtable;
    import java.util.Properties;

    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;

    import metier.entities.hotel;
    import metier.entities.reservation;
    import metier.session.HotelEJBImpl;
    import metier.session.IHotelLocal;


    public class main {

    public static void main(String[] args) {
    // TODO Auto-generated method stub

    final Hashtable p=new Hashtable();;
    Context ctx;
    IHotelLocal Metier = null;
    final String beanName = HotelEJBImpl.class.getSimpleName();
    try{
    System.out.println("aaaaaaa");


    p.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");
    //p.put("jboss.naming.client.ejb.context", true);
    ctx=new InitialContext(p);
    Metier=(IHotelLocal) ctx.lookup("ejb:HotelEAR/Gestion_Hotel/"+beanName+"!metier.session.IHotelLocal");
    }catch(NamingException k){
    k.printStackTrace();

    }
    System.out.println("**********");
    reservation R= Metier.consulterReservation((long)1234);
    //hotel h=new hotel((long)1334,"hkk",3);
    //Metier.addHotel(h);
    }

    }

  7. #7
    Membre actif
    Homme Profil pro
    Développeur Java/JavaEE
    Inscrit en
    Août 2014
    Messages
    194
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Java/JavaEE

    Informations forums :
    Inscription : Août 2014
    Messages : 194
    Points : 290
    Points
    290
    Par défaut
    Bonjour,

    Que contient la ligne 51 de ta classe main ??

  8. #8
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    décommente ta ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    //p.put("jboss.naming.client.ejb.context", true);

  9. #9
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Il y a un exemple complet ici

    https://github.com/jbandi/JavaExampl...EJBClient.java

    a comparer, on dirait que le nom de ton EJB n'est pas complet, il manque à minima le nom de l'application J2EE qui le fournis.

Discussions similaires

  1. Réponses: 3
    Dernier message: 13/11/2015, 16h01
  2. Réponses: 0
    Dernier message: 31/12/2014, 19h02
  3. "No source code is available for type"
    Par big.fares dans le forum GWT et Vaadin
    Réponses: 5
    Dernier message: 15/07/2009, 10h45
  4. Réponses: 9
    Dernier message: 19/02/2009, 13h17
  5. There is no source code available for the current location.
    Par christopheEU dans le forum ASP.NET
    Réponses: 2
    Dernier message: 05/06/2008, 11h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo