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 :

erreur create entité [EJB Session]


Sujet :

Java EE

  1. #1
    Membre du Club Avatar de trin86
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    171
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2008
    Messages : 171
    Points : 63
    Points
    63
    Par défaut erreur create entité
    Bonjour à tous,

    J'ai écrit un projet J2EE avec mes beans entités + un CRUD générique + une couche service où j'implemente les méthodes de chaque entité.

    J'ai créé un projet test où je fais un create puis un find d'un meme objet.
    Voilà les erreurs que j'obtient:
    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
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
     
    Exception in thread "main" javax.ejb.EJBException: java.lang.NullPointerException
    	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:487)
    	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:908)
    	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
    Caused by: java.lang.NullPointerException
    	at com.marinesoft.service.UserBean.create(UserBean.java:32)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
    	at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
    	at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
    	at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
    	at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_18733404.invoke(InvocationContextInterceptor_z_fillMethod_18733404.java)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
    	at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_18733404.invoke(InvocationContextInterceptor_z_setup_18733404.java)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:487)
    	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:908)
    	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
    	at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:206)
    	at org.jboss.remoting.Client.invoke(Client.java:1708)
    	at org.jboss.remoting.Client.invoke(Client.java:612)
    	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.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
    	at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
    	at $Proxy2.create(Unknown Source)
    	at test.main(test.java:26)
    	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.handler.ProxyInvocationHandlerBase.invoke(ProxyInvocationHandlerBase.java:261)
    	at org.jboss.ejb3.proxy.handler.session.SessionSpecProxyInvocationHandlerBase.invoke(SessionSpecProxyInvocationHandlerBase.java:101)
    	at $Proxy2.create(Unknown Source)
    	at test.main(test.java:26)
    le déploiement se fait sans erreurs.

    Ma classe test:
    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
     
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
     
    import com.marinesoft.Iservice.*;
    import com.marinesoft.service.*;
    import com.marinesoft.donnee.*;
     
     
    public class test {
     
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		System.out.println("main.exe");
    		try{
    			Context usercxt = new InitialContext();                               
    	         Iuser iu = (Iuser) usercxt.lookup("UserBean/remote");	
     
    //////////////////create a user////////////////
    	         System.out.println("méthode create");
    	      User user = new User(0, "Badaoui", "Amel", "", "", "", "", "", "", "", "", "sa", "ap115j83");
    	      System.out.println("le user à insérer est de pointeur:"+user);
              User user1 = iu.create(user,0);
             System.out.println("user created");
     
    //////////////////find the created user////////////////
             System.out.println("méthode find");
                 User user2 = iu.findById(0);
                 System.out.println("The created user was found and his name is "+user2.getNom());
     
     
    		}catch (NamingException e) {
    			System.out.println("exception ici");
    	         e.printStackTrace();
    	      }
       	}
    }
    La classe UserBean:
    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
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
     
    package com.marinesoft.service;
     
    import java.util.List;
     
    import com.marinesoft.Iservice.Iuser;
    import com.marinesoft.genericDAO.*;
    import com.marinesoft.donnee.User;
     
    import javax.ejb.EJB;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
     
    /**
     * Session Bean implementation class UserBean
     */
    @Stateless
    @Remote( { Iuser.class })
    public class UserBean implements Iuser {
     
     
    	private IGenericDao<User, Integer> IUserDao;
        /**
         * Default constructor. 
         */
        public UserBean() {
            // TODO Auto-generated constructor stub
        }
    //*********************CRUD***************************************
        //*******************create***********************************
        public User create(User U, int codeUser){
        	return IUserDao.create(U, codeUser);
        }
     
      //*******************update***********************************
        public User update(User U, int codeUser){
        	return IUserDao.update(U, codeUser);
        }
     
      //*******************delete***********************************
        public void delete(int codeUser){
        	IUserDao.delete(codeUser);
        }
     
      //*******************findbyid***********************************
        public User findById(int codeUser){
        	return IUserDao.findById(codeUser);
        }
     
      //*******************findall***********************************
        public List<User> findAll(){
        	return IUserDao.findAll();
        }
    }
    Merci d'avance

  2. #2
    Membre à l'essai
    Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Mai 2006
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information

    Informations forums :
    Inscription : Mai 2006
    Messages : 15
    Points : 19
    Points
    19
    Par défaut DAO non initialisee
    Il manque l'initialisation du DAO.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    public class UserBean implements Iuser {
     
    	private IGenericDao<User, Integer> IUserDao;
    Je pense qu'il faut injecter le DAO avec l'annotation @EJB apres l'avoir defini en tant que session bean avec une interface locale.

  3. #3
    Membre du Club Avatar de trin86
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    171
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2008
    Messages : 171
    Points : 63
    Points
    63
    Par défaut
    svp est ce que c'est possible d'utiliser une seule interface générique pour tous les CRUDs session de tous les objets et faire le remote vers cette interface.
    merci

  4. #4
    Membre du Club Avatar de trin86
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    171
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2008
    Messages : 171
    Points : 63
    Points
    63
    Par défaut [JDBCExceptionReporter] Syntaxe incorrecte
    OUI, finalement c'est possible.
    Maintenant lors du déploiement je rencontre un autre bug au niveau de sql, voici l'affaichage de la console server:
    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
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
     
    12:14:26,082 INFO  [STDOUT] ***************************************1
    12:14:26,098 INFO  [STDOUT] class com.marinesoft.donnee.User
    12:14:26,630 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
    12:14:26,630 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
    12:14:26,630 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.createORupdate(java.lang.Object)
    12:14:26,661 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.create(java.lang.Object,java.io.Serializable)
    12:14:26,661 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.util.List com.marinesoft.genericDAO.GenericDao.findAll()
    12:14:26,677 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public void com.marinesoft.genericDAO.GenericDao.setEntityManager(javax.persistence.EntityManager)
    12:14:26,693 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.update(java.lang.Object,java.io.Serializable)
    12:14:26,693 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Class com.marinesoft.genericDAO.GenericDao.getClasseEntite()
    12:14:26,708 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.findById(java.io.Serializable)
    12:14:26,724 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public void com.marinesoft.genericDAO.GenericDao.delete(java.io.Serializable)
    12:14:26,724 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.createORupdate(java.lang.Object)
    12:14:26,740 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.create(java.lang.Object,java.io.Serializable)
    12:14:26,740 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.util.List com.marinesoft.genericDAO.GenericDao.findAll()
    12:14:26,755 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public void com.marinesoft.genericDAO.GenericDao.setEntityManager(javax.persistence.EntityManager)
    12:14:26,755 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.update(java.lang.Object,java.io.Serializable)
    12:14:26,771 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Class com.marinesoft.genericDAO.GenericDao.getClasseEntite()
    12:14:26,787 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.Object com.marinesoft.genericDAO.GenericDao.findById(java.io.Serializable)
    12:14:26,787 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public void com.marinesoft.genericDAO.GenericDao.delete(java.io.Serializable)
    12:14:26,974 INFO  [STDOUT] ***************************************4
    12:14:26,974 INFO  [STDOUT] org.jboss.jpa.tx.TransactionScopedEntityManager@e52256--------class com.marinesoft.donnee.User------0------avant em.find
    12:14:27,616 INFO  [STDOUT] Hibernate: 
        select
            user0_.code_user as code1_127_0_,
            user0_.adresse as adresse127_0_,
            user0_.adrnet as adrnet127_0_,
            user0_.cpostal as cpostal127_0_,
            user0_.email as email127_0_,
            user0_.fax as fax127_0_,
            user0_.identifiant as identifi7_127_0_,
            user0_.mot_de_passe as mot8_127_0_,
            user0_.nom as nom127_0_,
            user0_.prenom as prenom127_0_,
            user0_.tel as tel127_0_,
            user0_.tlx as tlx127_0_,
            user0_.ville as ville127_0_ 
        from
            USER user0_ 
        where
            user0_.code_user=?
    12:14:27,929 WARN  [JDBCExceptionReporter] SQL Error: 156, SQLState: S0001
    12:14:27,929 ERROR [JDBCExceptionReporter] Syntaxe incorrecte vers le mot clé 'USER'.
    12:14:27,945 INFO  [DefaultLoadEventListener] Error performing load command
    org.hibernate.exception.SQLGrammarException: could not load an entity: [com.marinesoft.donnee.User#0]
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    	at org.hibernate.loader.Loader.loadEntity(Loader.java:1895)
    	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
    	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
    	at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)
    	at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
    	at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
    	at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
    	at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
    	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
    	at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
    	at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842)
    	at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835)
    	at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
    	at org.jboss.jpa.tx.TransactionScopedEntityManager.find(TransactionScopedEntityManager.java:176)
    	at com.marinesoft.genericDAO.GenericDao.findById(GenericDao.java:68)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
    	at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
    	at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
    	at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
    	at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_11086506.invoke(InvocationContextInterceptor_z_fillMethod_11086506.java)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
    	at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_11086506.invoke(InvocationContextInterceptor_z_setup_11086506.java)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
    	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
    	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:487)
    	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:908)
    	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Syntaxe incorrecte vers le mot clé 'USER'.
    	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
    	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    	at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
    	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    	at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
    	at org.hibernate.loader.Loader.doQuery(Loader.java:697)
    	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    	at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
    	... 71 more
    12:14:28,007 ERROR [ServerThread] WorkerThread#0[127.0.0.1:4767] exception occurred during first invocation
    java.io.NotSerializableException: com.microsoft.sqlserver.jdbc.StreamError
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    	at org.hibernate.exception.NestableRuntimeException.writeObject(NestableRuntimeException.java:181)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    	at java.lang.Throwable.writeObject(Throwable.java:648)
    	at sun.reflect.GeneratedMethodAccessor261.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    	at java.lang.Throwable.writeObject(Throwable.java:648)
    	at sun.reflect.GeneratedMethodAccessor261.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
    	at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    	at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    	at java.io.ObjectOutputStream.writeObject(Unknown Source)
    	at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObjectVersion2_2(JavaSerializationManager.java:120)
    	at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:95)
    	at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:120)
    	at org.jboss.remoting.transport.socket.ServerThread.versionedWrite(ServerThread.java:998)
    	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:781)
    	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
    	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
    	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
    J'ai cherché partout je vois pas comment résoudre. je rappelle j'utilise JPA hibernate pour la persistance avec api Dali, et aussi des EJB session avec remote générique.
    merci

  5. #5
    Membre du Club Avatar de trin86
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    171
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2008
    Messages : 171
    Points : 63
    Points
    63
    Par défaut résolu
    enfaite il fallait juste rajouter dans le bean entité:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    @Table(name = "[USER]", schema = "dbo")
    maintenant ça marche bien

    merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur create table
    Par bouchra19 dans le forum SQL
    Réponses: 2
    Dernier message: 12/04/2012, 15h15
  2. Erreur Create table/foreign Key
    Par vashe9 dans le forum Requêtes
    Réponses: 8
    Dernier message: 04/09/2011, 16h29
  3. Erreur Create table lors d'un import Transport Tablespace
    Par ccaye dans le forum Import/Export
    Réponses: 3
    Dernier message: 26/05/2010, 16h46
  4. erreur create table
    Par Snooker dans le forum MySQL
    Réponses: 1
    Dernier message: 02/04/2010, 20h46
  5. erreur create table
    Par slefevre01 dans le forum SQL Procédural
    Réponses: 2
    Dernier message: 10/02/2006, 17h43

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