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 :

Message d'erreur bean.findContact


Sujet :

Java EE

  1. #1
    Provisoirement toléré
    Inscrit en
    Avril 2007
    Messages
    679
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 679
    Points : 76
    Points
    76
    Par défaut Message d'erreur bean.findContact
    salut tout le monde
    j'ai un problème avec la session bean la méthode 'findContact' chercher les contacte mais message d'erreur
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
    Exception in thread "main" java.lang.NullPointerException
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:379)
    	at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
    	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
    	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
    	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
    	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
    	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:211)
    	at org.jboss.remoting.Client.invoke(Client.java:1724)
    	at org.jboss.remoting.Client.invoke(Client.java:629)
    	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
    	at $Proxy3.invoke(Unknown Source)
    	at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
    	at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
    	at $Proxy2.findContact(Unknown Source)
    	at ejb.MyBeanClient.main(MyBeanClient.java:34)
    	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
    	at $Proxy3.invoke(Unknown Source)
    	at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
    	at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
    	at $Proxy2.findContact(Unknown Source)
    	at ejb.MyBeanClient.main(MyBeanClient.java:34)
    voila le code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
     
    import javax.ejb.Stateless;
    import javax.persistence.*;
    import entityBeans.Contact;
     
     
    @Stateless
    public class MyBean implements MyBeanRemote, MyBeanLocal {
     
     
     
    @PersistenceContext(unitName="mus")
        EntityManager em;
          public Contact findContact(int id) {
        	 return em.find(Contact.class, id);
        	 }
     
         }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    public interface IMyBean extends Serializable {   
             public Contact findContact(int contact);
     
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    import javax.ejb.Remote;
     
    @Remote
    public interface MyBeanRemote extends IMyBean  {
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
     
    package ejb;
     
     
     import javax.naming.InitialContext;
    import javax.naming.NamingException;
     
    import entityBeans.Contact;
    public class MyBeanClient {
     
    	private static final Contact Contact = null;
     
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		 try {
     
    			    System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
    			   System.setProperty("java.naming.provider.url", "localhost:1099");
     
    			   InitialContext ctx = new InitialContext();           
    			   MyBeanRemote bean = (MyBeanRemote) ctx.lookup("MyBean/remote");
    			    Contact con = bean.findContact(1);
    	 		   con.getFirstName();
     
     
     
    			        } catch (NamingException e) {
    			            e.printStackTrace();
    			        }
     
    	}
     
    }
    merci d'avance

  2. #2
    Provisoirement toléré
    Inscrit en
    Avril 2007
    Messages
    679
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 679
    Points : 76
    Points
    76
    Par défaut
    je coince quelqu'un à une idée merci

  3. #3
    Membre expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Bjr,
    Peut on avoir les traces complètes?
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

Discussions similaires

  1. message d'erreur : bean
    Par youssef222 dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 08/02/2010, 10h31
  2. Réponses: 21
    Dernier message: 13/02/2008, 17h16
  3. Réponses: 4
    Dernier message: 04/03/2003, 01h05
  4. [CR] Message d'erreur
    Par nono1 dans le forum SAP Crystal Reports
    Réponses: 2
    Dernier message: 11/09/2002, 14h54
  5. Réponses: 2
    Dernier message: 27/05/2002, 19h46

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