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 :

Utiliser plusieurs bases de données en JEE


Sujet :

Java EE

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut Utiliser plusieurs bases de données en JEE
    Bonsoir à tous
    j'ai une application J2EE que je développe sur la base d'un existant php. en effet, au lancement de l'application on doit choisir sur qu'elle base de données de connecter. Le problème avec JEE c'est qu'on configure l'accès aux données par avance en utilisant les datasource. Ma question est donc de savoir s'il existe un moyen de décrire dynamique les paramètres du fichier sun-resources.xml comme le nom de la base de données par exemple.

  2. #2
    Membre expérimenté Avatar de Cincinnatus
    Homme Profil pro
    Développeur d'applications métier
    Inscrit en
    Mars 2007
    Messages
    592
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Développeur d'applications métier
    Secteur : Service public

    Informations forums :
    Inscription : Mars 2007
    Messages : 592
    Points : 1 679
    Points
    1 679
    Par défaut
    Bonjour,

    Si les bases sont connues au départ, pourquoi ne pas indiquer les différentes configurations pour différentes datasource et permettre de choisir ensuite via l'application ?

  3. #3
    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
    1) non on n'est pas obligé d'utiliser des datasource, même si c'est fortement recommandé car ça s'intègre aux transactions conteneur, ça gère le pooling et c'est managé par le conteneur
    2) tu peux avoir autant de datasource que tu veux, donc ça n'empeche pas un choix
    3) ton application n'a pas à écrire le sun-resources.xml car elle n'a même pas à connaitre qu'elle tourne sur un glassfish
    4) si tu décrivait plus en avant ton problème qu'on puisse te suggérer une solution adaptée?

  4. #4
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Voici ce que j'ai essayé de faire en utilisant éclipseLink et ce qu'il faut savoir c'est que lez nom de la bd n'est pas connu d'avance et le nombre aussi car l'opérateur pourait en créer autant qu'il le désire mais avec la même structure à chaque fois. voici donc mon code de connexion à base de données choisi.
    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
     
     static EntityManagerFactory emf;
         static  EntityManager em2;
        static  EntityTransaction tx;
     
        public ConnexionEM() {
        // connection();
        }
     
        public static void connection(String bd){
            Map<Object, String> properties = new HashMap<Object, String>();
     
            // Ensure RESOURCE_LOCAL transactions is used.
        properties.put(TRANSACTION_TYPE,
            PersistenceUnitTransactionType.RESOURCE_LOCAL.name());
          // Configure the internal EclipseLink connection pool
        properties.put(JDBC_DRIVER, "com.mysql.jdbc.Driver");
        properties.put(JDBC_URL, "jdbc:mysql://localhost:3306/"+bd);
        properties.put(JDBC_USER, "didier");
        properties.put(JDBC_PASSWORD, "*****");
     
         // Configure logging. FINE ensures all SQL is shown
        properties.put(LOGGING_LEVEL, "FINE");
        properties.put(LOGGING_TIMESTAMP, "false");
        properties.put(LOGGING_THREAD, "false");
        properties.put(LOGGING_SESSION, "false");
     
        // Ensure that no server-platform is configured
        properties.put(TARGET_SERVER, TargetServer.None);
     
          emf = Persistence.createEntityManagerFactory(
          "iplansERPw-ejbPU2", properties);
          em2 = emf.createEntityManager();
          tx = em2.getTransaction();
          tx.begin();
          if( em2.isOpen()){           
              tx.commit();
              em2.close();
              em2 = emf.createEntityManager();
              tx = em2.getTransaction();
          tx.begin();
          }else{
              em2 = emf.createEntityManager();
          tx = em2.getTransaction();
          tx.begin();
          }
    //      
     
     
     
            //System.out.println(em2.getProperties()); 
      }  
     
     
     
         public static void arretConnexion(){
         tx.commit();
     
         em2.close();
         emf.close();
     
         }
    ça marche et ça se positionne bien sur la base de données choisie . Le problème se situe au niveau des converters jsf j'ai une erreur qui revient de temps en temps.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    Avertissement:   StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.ClassCastException: com.iplans.jpa2.Pers cannot be cast to com.iplans.jpa2.Pers
    	at converters.PersConverter.getAsString(PersConverter.java:59)
    	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:521)
    je ne trouve pas le moyen de résoudre cette difilcuté.

  5. #5
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    voici l'erreur que je n'arrive pas à résoudre
    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
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
     
    Infos:   [EL Warning]: metadata: You have specified multiple ids for the entity class [com.iplans.myEntities.MyFactureTpv] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have to use JPQL queries to read your entities. For other id options see @PrimaryKey.
    Infos:   [EL Config]: metadata: The alias name for the entity class [class com.iplans.jpa2.Ventillationfa] is being defaulted to: Ventillationfa.
    Infos:   [EL Config]: metadata: The alias name for the entity class [class com.iplans.myEntities.MyCreditOctroyeFlash] is being defaulted to: MyCreditOctroyeFlash.
    Infos:   [EL Config]: metadata: The table name for entity [class com.iplans.myEntities.MyCreditOctroyeFlash] is being defaulted to: MYCREDITOCTROYEFLASH.
    Infos:   [EL Config]: metadata: The column name for element [nEng] is being defaulted to: NENG.
    Infos:   [EL Config]: metadata: The column name for element [montant] is being defaulted to: MONTANT.
    Infos:   [EL Config]: metadata: The column name for element [designation] is being defaulted to: DESIGNATION.
    Infos:   [EL Config]: metadata: The column name for element [quantite] is being defaulted to: QUANTITE.
    Infos:   [EL Info]: EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
    Infos:   [EL Fine]: connection: Detected database platform: org.eclipse.persistence.platform.database.MySQLPlatform
    Infos:   [EL Config]: connection: Connection(243657999)--connecting(DatabaseLogin(
    	platform=>MySQLPlatform
     
    ))
     
    Avertissement:   A system exception occurred during an invocation on EJB UtilisateurSessionBean, method: public java.util.List com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs() throws java.lang.Exception
    Avertissement:   javax.ejb.EJBException
    	at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
    	at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    	at com.sun.proxy.$Proxy450.listeUtilisateurs(Unknown Source)
    	at com.iplans.dao.__EJB31_Generated__UtilisateurSessionBean__Intf____Bean__.listeUtilisateurs(Unknown Source)
    	at com.iplans.managedBeans.Authentification.getListePersonnes(Authentification.java:337)
    	at com.iplans.managedBeans.Authentification.initModule(Authentification.java:289)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at javax.el.ELUtil.invokeMethod(ELUtil.java:332)
    	at javax.el.BeanELResolver.invoke(BeanELResolver.java:537)
    	at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
    	at com.sun.el.parser.AstValue.invoke(AstValue.java:283)
    	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
    	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
    	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
    	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
    	at com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs(UtilisateurSessionBean.java:40)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
    	at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
    	at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
    	at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
    	at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
    	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    	... 54 more
    Caused by: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.exceptions.QueryException.descriptorIsMissing(QueryException.java:478)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkDescriptor(ObjectLevelReadQuery.java:821)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:819)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
    	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469)
    	... 86 more
     
    Grave:   javax.ejb.EJBException
    	at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
    	at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    	at com.sun.proxy.$Proxy450.listeUtilisateurs(Unknown Source)
    	at com.iplans.dao.__EJB31_Generated__UtilisateurSessionBean__Intf____Bean__.listeUtilisateurs(Unknown Source)
    	at com.iplans.managedBeans.Authentification.getListePersonnes(Authentification.java:337)
    	at com.iplans.managedBeans.Authentification.initModule(Authentification.java:289)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at javax.el.ELUtil.invokeMethod(ELUtil.java:332)
    	at javax.el.BeanELResolver.invoke(BeanELResolver.java:537)
    	at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
    	at com.sun.el.parser.AstValue.invoke(AstValue.java:283)
    	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
    	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
    	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
    	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
    	at com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs(UtilisateurSessionBean.java:40)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
    	at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
    	at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
    	at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
    	at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
    	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    	... 54 more
    Caused by: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.exceptions.QueryException.descriptorIsMissing(QueryException.java:478)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkDescriptor(ObjectLevelReadQuery.java:821)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:819)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
    	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469)
    	... 86 more
     
    Infos:   [EL Warning]: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    Avertissement:   A system exception occurred during an invocation on EJB UtilisateurSessionBean, method: public java.util.List com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs() throws java.lang.Exception
    Avertissement:   javax.ejb.EJBException
    	at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
    	at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    	at com.sun.proxy.$Proxy450.listeUtilisateurs(Unknown Source)
    	at com.iplans.dao.__EJB31_Generated__UtilisateurSessionBean__Intf____Bean__.listeUtilisateurs(Unknown Source)
    	at com.iplans.managedBeans.Authentification.getListePersonnes(Authentification.java:337)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
    	at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    	at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    	at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
    	at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
    	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
    	at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
    	at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    	at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    	at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    	at javax.faces.component.UISelectItems.getValue(UISelectItems.java:129)
    	at com.sun.faces.renderkit.SelectItemsIterator.initializeItems(SelectItemsIterator.java:208)
    	at com.sun.faces.renderkit.SelectItemsIterator.hasNext(SelectItemsIterator.java:135)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:762)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:847)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:297)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeDynamicBody(PanelGridRenderer.java:131)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableBody(PanelGridRenderer.java:102)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableLayout(PanelGridRenderer.java:65)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:37)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
    	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
    	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    	at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:187)
    	at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:116)
    	at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:48)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
    	at com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs(UtilisateurSessionBean.java:40)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
    	at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
    	at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
    	at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
    	at sun.reflect.GeneratedMethodAccessor457.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
    	at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
    	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    	... 78 more
    Caused by: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.exceptions.QueryException.descriptorIsMissing(QueryException.java:478)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkDescriptor(ObjectLevelReadQuery.java:821)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:819)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
    	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469)
    	... 109 more
     
    Grave:   javax.ejb.EJBException
    	at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:748)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:698)
    	at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:503)
    	at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
    	at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    	at com.sun.proxy.$Proxy450.listeUtilisateurs(Unknown Source)
    	at com.iplans.dao.__EJB31_Generated__UtilisateurSessionBean__Intf____Bean__.listeUtilisateurs(Unknown Source)
    	at com.iplans.managedBeans.Authentification.getListePersonnes(Authentification.java:337)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
    	at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    	at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    	at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
    	at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
    	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
    	at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
    	at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    	at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    	at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    	at javax.faces.component.UISelectItems.getValue(UISelectItems.java:129)
    	at com.sun.faces.renderkit.SelectItemsIterator.initializeItems(SelectItemsIterator.java:208)
    	at com.sun.faces.renderkit.SelectItemsIterator.hasNext(SelectItemsIterator.java:135)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:762)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:847)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:297)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeDynamicBody(PanelGridRenderer.java:131)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableBody(PanelGridRenderer.java:102)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableLayout(PanelGridRenderer.java:65)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:37)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
    	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85)
    	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    	at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:187)
    	at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:116)
    	at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:48)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    	at java.lang.Thread.run(Thread.java:748)
    Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:480)
    	at com.iplans.dao.UtilisateurSessionBean.listeUtilisateurs(UtilisateurSessionBean.java:40)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
    	at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
    	at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
    	at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
    	at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
    	at sun.reflect.GeneratedMethodAccessor457.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
    	at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
    	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
    	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
    	at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
    	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
    	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    	... 78 more
    Caused by: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    	at org.eclipse.persistence.exceptions.QueryException.descriptorIsMissing(QueryException.java:478)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkDescriptor(ObjectLevelReadQuery.java:821)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:819)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
    	at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
    	at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    	at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469)
    	... 109 more
     
    Infos:   [EL Warning]: Exception [EclipseLink-6007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.QueryException
    Exception Description: Missing descriptor for [class com.iplans.myEntities.MyPers].
    Query: ReadAllQuery(referenceClass=MyPers sql="Select * From pers")
    Infos:   [EL Fine]: sql: Connection(716845389)--SELECT ID_MODULE, DESCRIPTION, DOSSIER, MODULE, NOM_LONG_MODULE, STATUT_MODULE FROM modules WHERE (STATUT_MODULE = ?)
    	bind => [1]
    Avertissement:   JSF1091 : Aucun type mime détecté pour le fichier fa/fontawesome-webfont.woff2.  Pour résoudre ce problème, ajoutez un mappage mime-type au fichier web.xml de l’application.
    Avertissement:   JSF1091 : Aucun type mime détecté pour le fichier fa/fontawesome-webfont.woff2.  Pour résoudre ce problème, ajoutez un mappage mime-type au fichier web.xml de l’application.

    ma requête la voici:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
          Query q;
            q =  ConnexionEM.em2.createNativeQuery("Select * From pers", com.iplans.myEntities.MyPers.class);
                    return  q.getResultList();
    mon custom converter

    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
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package converters;
     
    import com.iplans.dao.UtilisateurSessionBean;
    import com.iplans.jpa2.Pers;
    import com.iplans.jpa2.PersPK;
    import javax.ejb.EJB;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import javax.faces.convert.FacesConverter;
     
    /**
     *
     * @author DIDIER
     */
    @FacesConverter(value = "persC")
    public class PersConverter implements Converter{
        @EJB
         UtilisateurSessionBean userFacade;
     
        private Pers maPersonne;
        private PersPK paPersonnePK;
     
         @Override
        public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) {
           if (submittedValue != null && !submittedValue.trim().isEmpty()){
     
             paPersonnePK = new PersPK();
             String[] vals = submittedValue.split(":");
             String val0 = vals[0];
             String val1 = vals[1];
             paPersonnePK.setNEng(Integer.parseInt(val0));
             paPersonnePK.setIndexe(val1);
               try {                
                  maPersonne =  userFacade.findPersbyID(paPersonnePK);
                  return maPersonne;
     
                }catch(Exception e) {
                    throw new  ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Personne invalide"));
                }
            }
            else {
                return null;    
            }     
     
        }
     
        @Override
        public String getAsString(FacesContext context, UIComponent component, Object value) {
            if(value != null) {
     
                return String.valueOf(((Pers) value).getPersPK());
     
            }
            else {
                return null;
            }        
     
        }
    }
    je suis calé sur cette erreur!

  6. #6
    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
    Bon, déjà, sur un serveur J2EE, tu oublie d'office les état statique comme tu fait. C'est un coup à tout faire péter en production. Statique (avec état) ça rime pas bien du tout avec parallélisme et multi utilisateur.

    Ensuite, vu que tu ne passe pas par des datasources, tu peux te brosser pour le transaction manager et le pooling. Vu que tu te brosse pour ça, tu va en chier des barres pour créer un entitymanager à la volée avec ta configuration base de données. Pour résumer dans l'ordre ce que tu dois faire

    1) créer un persistence unit avec toute la config pour te connecter à la db. Assure toi que ça marche
    2) prend toutes les propriété que t'as définis là, met les dans ton code plutot que dans le persistence unit, assure toi que ça marche
    3) rends ces paramèters dynamique dans ton code pour pouvoir choisir la db à la volée. Assure toi que ça marche
    4) Met dans un EJB ou un bean de service quelconque une forme de stockage qui garderait les entitymanager facotry. La création d'une factory pouvant mettre plusieurs secondes suivant le modèle, tu n'as pas envie de le faire à chaque fois, mais plutot te consituer une série de factory que tu peux appeler, et qui correspondent à toutes les DB supporter
    5) essaie de rajoute du pooling là au dessus pour les performance.


    Tu t'oriente vers une chemin long, chiant, périlleux et pas vraiment recommandé. Il y a vraiment une raison business pour laquelle
    1) l'application aie besoin de plusieurs base de données?
    2) cette liste ne peut pas être établie directement dans le conteneur?

    En général quand le but est d'isoler les clients, le plus simple c'est soit avoir une app par client soit avoir un base de données partagée

  7. #7
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Merci pour votre réponse Mr Tchize je vais assayer de mettre en oeuvre vos suggestions. en effets :
    Oui il y a une raison liée à l'existant qui fait que l'on ne connaisse pas d'avance toutes les bases de données qui seront en jeux.

    Conclusion je suis obligé de taffer. Sinon le point 5 je ne sais pas encore comment faire ça mais je vais me documenter et mettre cela en oeuvre.
    Je reviens vers vous pour les avancer et clôturer le sujet.

  8. #8
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Bonjour à tous!
    dans mon application j'ai été appelé à créer des pojo pour faire un mapping avec des requêtes avec jointures. Maintenant que j'utilise EclipseLink pour géré les entités et les transactions à la place de JTA j'obtient ce genre d'erreur fréquemment.
    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
     
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
    	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:900)
    	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:962)
    	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:631)
    	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2002)
    	at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:298)
    	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
    	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
    	at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.updateObject(DatasourceCallQueryMechanism.java:797)
    	at org.eclipse.persistence.internal.queries.StatementQueryMechanism.updateObject(StatementQueryMechanism.java:435)
    	at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:1079)
    	at org.eclipse.persistence.queries.UpdateObjectQuery.executeCommitWithChangeSet(UpdateObjectQuery.java:84)
    	at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:301)
    	at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
    	at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
    	at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:798)
    	at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
    	at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1737)
    	at org.eclipse.persistence.internal.sessions.CommitManager.commitChangedObjectsForClassWithChangeSet(CommitManager.java:267)
    	at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:130)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:4207)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1441)
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkImpl.java:1587)
    	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:452)
    	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:863)
    	... 93 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'demo.myarticlesservice' doesn't exist
    	at sun.reflect.GeneratedConstructorAccessor289.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    	at com.mysql.jdbc.Util.getInstance(Util.java:386)
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2441)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2366)
    	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2350)
    	at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:890)
    	... 121 more
     
    Grave:   javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'demo.myarticlesservice' doesn't exist
    Error Code: 1146
    Call: UPDATE MYARTICLESSERVICE SET ENSTOCK = ? WHERE ((NENG = ?) AND (INDEXE = ?))
    	bind => [1.0, 884, DEMOS73658144945843_Superviseur15582]
    Quelqu'un aurait des piste pour éviter cette erreur qui intervient lorsque j'utilise un setter sur ce pojo "MyArticlesService"? évidemment ce n'est pas une table de la base de données.
    Merci d'avance!

  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
    Créer la table qui manque?

  10. #10
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Merci Mr Tchize mais la base de données ne peux pas être modifié. pour pouvoir effectuer des requêtes avec jointures j'ai du créer des entités personnalisées pour mapper le résultat desdites requêtes d'ou les POJO comme MyArticlesServices.

  11. #11
    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
    ouais sauf que là t'as déclaré ce pojo comme étant une entité, donc elle doit avoir une table. Si la table n'existe pas, ne crée pas d'entité dessus.

  12. #12
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Bonjour tous !
    Je reviens vers vous toujours dans le cadre de mon application qui utilise plusieurs bases de données. j'avais opté pour EclipseLink hors du container Glassfish. je suis face à certains probleme et je sollicite votre éclairage:
    1- lorsque je fais des modification et que je deploie à travers Netbeans j'ai l'erreur suivante:
    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
    Avertissement:   StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.ClassCastException: com.didier.jpa2.Pers cannot be cast to com.didier.jpa2.Pers
    	at converters.PersConverter.getAsString(PersConverter.java:62)
    	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:521)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:534)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:794)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:847)
    	at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:297)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeDynamicBody(PanelGridRenderer.java:131)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableBody(PanelGridRenderer.java:102)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableLayout(PanelGridRenderer.java:65)
    	at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:37)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)...
    l'autre soucis que je rencontre c'est que l'application étant dans un système distribué, la base de données peut être modifié hors de l'application, il se pose alors le problème de rafraîchissement. et il faut sortir de l'application et rentrer de nouveau pour constater les modifications apportées à la bd.

    ci-joint mon ejb permettant la connexion une qu'on lui envoie le nom de la base sur laquelle se connecter.
    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
    @Stateless
    public class ConnexionEM {
     
     public EntityManagerFactory emf;
         public  EntityManager em2;
        public  EntityTransaction tx;
     
        public ConnexionEM() {
    //    connection();
        }
         public String bd ="";
     
          public String getBd(String bd){  
              this.bd =bd;
          return bd;
          }
     
        public void connection(String bd1){
            this.bd = bd1;
            Map properties = new HashMap();
     
            // Ensure RESOURCE_LOCAL transactions is used.
        properties.put(TRANSACTION_TYPE,
            PersistenceUnitTransactionType.RESOURCE_LOCAL.name());
          // Configure the internal EclipseLink connection pool
        properties.put(JDBC_DRIVER, "com.mysql.jdbc.Driver");
        properties.put(JDBC_URL, "jdbc:mysql://localhost:3306/"+bd1);
        properties.put(JDBC_USER, "root");
        properties.put(JDBC_PASSWORD, "*****");
     
         // Configure logging. FINE ensures all SQL is shown
        properties.put(LOGGING_LEVEL, "FINE");
        properties.put(LOGGING_TIMESTAMP, "false");
        properties.put(LOGGING_THREAD, "false");
        properties.put(LOGGING_SESSION, "false");
     
        // Ensure that no server-platform is configured
        properties.put(TARGET_SERVER, TargetServer.None);
        properties.put(WEAVING, NONE);
     
          emf = Persistence.createEntityManagerFactory("myPU-ejbPU2", properties);
          em2 = emf.createEntityManager();
          tx = em2.getTransaction();
     
          tx.begin();
          if(em2.isOpen()){   
              em2.flush();
              tx.commit();
              em2.close();
              em2 = emf.createEntityManager();
              tx = em2.getTransaction();
          tx.begin();
          }else{
              em2 = emf.createEntityManager();
          tx = em2.getTransaction();
          tx.begin();
          }
     
      }  
     
     
     
         public void arretConnexion(){
     
         em2.close();
         emf.close();
     
         }
        public EntityManager getEM(){
        return em2;
        }
     
    }
    Merci d'avance pour vos indications

  13. #13
    Membre actif
    Homme Profil pro
    Architecte technique
    Inscrit en
    Août 2006
    Messages
    178
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

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

    Informations forums :
    Inscription : Août 2006
    Messages : 178
    Points : 274
    Points
    274
    Par défaut
    1- problème de classloader: tu charges ta classe sur 2 classloaders différents. Comme ça je ne saurais te dir pourquoi ni comment.
    2- il ne faut pas avoir de cache ce qui impactera fortement les performances.

  14. #14
    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
    Ce problème arrive quand une instance est créer avec un classloader X et testée dans un classloader Y.

    Pour debugger ça c'est un peu galère, il faut identifier les deux classloader concerné. Une solution serait de regarder d'un coté l'objet que tu as

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    objet.getClass().getClassLoader()
    et de l'autre le type vers lequel tu caste:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Class.forName("nom.complet.de.Classe").getClassLoader()

    et de comparer les deux. Souvent le toString du classloader est explicite, sinon va falloir aller explorer dedans.


    Typiquement, je dirais que t'as foutu ta classe à la fois dans ton war et dans un classloader système de ton conteneur.

  15. #15
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    Bonsoir à tous et merci pour vos suggestions...
    Merci Tchize c'est vrai que je ne suis pas très à l'aise la... sinon voici ma classe Pers

    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
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
     
    public class Pers implements Serializable {
        private static final long serialVersionUID = 1L;
        @EmbeddedId
        protected PersPK persPK;
        @Basic(optional = false)
        @NotNull
        @Size(min = 1, max = 100)
        @Column(nullable = false, length = 100)
        private String site;
        @Size(max = 15)
        @Column(length = 15)
        private String civilite;
        @Size(max = 100)
        @Column(length = 100)
        private String nom;
        @Size(max = 100)
        @Column(length = 100)
        private String prenom;
        @Size(max = 100)
        @Column(length = 100)
        private String grade;
        private Integer assurance;
        @Size(max = 50)
        @Column(length = 50)
        private String matricule;
        @Size(max = 50)
        @Column(length = 50)
        private String matriculeInterne;
        @Size(max = 15)
        @Column(length = 15)
        private String cni;
        @Size(max = 100)
        @Column(length = 100)
        private String departement;
        @Size(max = 100)
        @Column(length = 100)
        private String departement1;
        // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
        @Size(max = 100)
        @Column(length = 100)
        private String email;
        @Size(max = 100)
        @Column(length = 100)
        private String emailProfessionnel;
        @Size(max = 100)
        @Column(length = 100)
        private String agenceBanque;
        @Size(max = 50)
        @Column(length = 50)
        private String codeBanque;
        @Size(max = 50)
        @Column(length = 50)
        private String codeGuichetBanque;
        @Size(max = 50)
        @Column(length = 50)
        private String codeSwiftBanque;
        @Size(max = 50)
        @Column(length = 50)
        private String numeroCompteBanque;
        @Size(max = 10)
        @Column(length = 10)
        private String cleRibBanque;
        @Size(max = 255)
        @Column(length = 255)
        private String agence;
        // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
        @Size(max = 40)
        @Column(length = 40)
        private String phone;
        @Size(max = 40)
        @Column(length = 40)
        private String telephoneProfessionnel;
        @Size(max = 200)
        @Column(length = 200)
        private String adresse;
        private Integer foto;
        @Size(max = 50)
        @Column(length = 50)
        private String signatureNumerique;
        @Size(max = 1024)
        @Column(length = 1024)
        private String fingerPrint1;
        @Size(max = 1024)
        @Column(length = 1024)
        private String fingerPrint2;
        @Size(max = 1024)
        @Column(length = 1024)
        private String fingerPrint3;
        @Size(max = 1024)
        @Column(length = 1024)
        private String fingerPrint4;
        @Size(max = 50)
        @Column(length = 50)
        private String image;
        @Size(max = 15)
        @Column(length = 15)
        private String signature;
        private Integer status;
        private Integer badge;
        @Size(max = 12)
        @Column(length = 12)
        private String dnais;
        private Integer iDDateNaissance;
        @Size(max = 50)
        @Column(length = 50)
        private String npere;
        @Size(max = 50)
        @Column(length = 50)
        private String nmere;
        @Size(max = 20)
        @Column(length = 20)
        private String vnais;
        @Size(max = 50)
        @Column(length = 50)
        private String nurg;
        @Size(max = 15)
        @Column(length = 15)
        private String nuurg;
        private Integer threadindex;
        private Integer threadindex1;
        private Integer lundi;
        private Integer mardi;
        private Integer mercredi;
        private Integer jeudi;
        private Integer vendredi;
        private Integer samedi;
        private Integer dimanche;
        private Integer vue;
        private Integer supp;
        @Column(name = "modif_pointage")
        private Integer modifPointage;
        // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
        @Column(precision = 22)
        private Double reccuperation;
        @Size(max = 5)
        @Column(length = 5)
        private String categorie;
        @Size(max = 5)
        @Column(length = 5)
        private String echelon;
        @Column(precision = 22)
        private Double salaireBaseMensuel;
        @Column(name = "taux_h")
        private Integer tauxH;
        private Integer heuresHebdo;
        @Size(max = 5)
        @Column(length = 5)
        private String loge;
        @Size(max = 5)
        @Column(length = 5)
        private String nourri;
        @Size(max = 20)
        @Column(name = "genre_salarie", length = 20)
        private String genreSalarie;
        @Size(max = 10)
        @Column(name = "date_entree", length = 10)
        private String dateEntree;
        @Size(max = 10)
        @Column(name = "date_contrat", length = 10)
        private String dateContrat;
        @Size(max = 20)
        @Column(name = "type_contrat", length = 20)
        private String typeContrat;
        @Size(max = 10)
        @Column(name = "date_sortie", length = 10)
        private String dateSortie;
        @Size(max = 255)
        @Column(name = "motif_depart", length = 255)
        private String motifDepart;
        @Size(max = 15)
        @Column(length = 15)
        private String majconges;
        private Integer archive;
        private Integer affichePlanning;
        private Integer situationMatrimoniale;
        private Integer nombreEnfant;
        @Size(max = 50)
        @Column(length = 50)
        private String pSeudo;
        private Integer saisieTPV;
        private Integer encaissementTPV;
        @Size(max = 1024)
        @Column(length = 1024)
        private String synchronization;
        private Integer nbMails;
        private Integer numeroOrdreSocial;
        @Size(max = 20)
        @Column(length = 20)
        private String lastUpDateTime;
        private Integer iDLastUpDate;
        @Size(max = 20)
        @Column(length = 20)
        private String codeAgence;
        @Size(max = 20)
        @Column(length = 20)
        private String codeUtilisateur;
        @Size(max = 20)
        @Column(length = 20)
        private String dateTime;
        @Size(max = 50)
        @Column(length = 50)
        private String numeroSocial;
        @Size(max = 50)
        @Column(length = 50)
        private String indexCarteAPuce;
        @Size(max = 50)
        @Column(length = 50)
        private String indexCompta;
        @Size(max = 50)
        @Column(length = 50)
        private String indexComptaAcompte;
        @Size(max = 50)
        @Column(length = 50)
        private String indexComptaOpposition;
        private Integer pointagePC;
        private Integer conforme;
        private Integer iDDateTime;
        private Integer archiveIDDate;
        @Size(max = 20)
        @Column(length = 20)
        private String archiveDate;
     
        public Pers() {
        }
     
        public Pers(PersPK persPK) {
            this.persPK = persPK;
        }
     
        public Pers(PersPK persPK, String site) {
            this.persPK = persPK;
            this.site = site;
        }
     
        public Pers(int nEng, String indexe) {
            this.persPK = new PersPK(nEng, indexe);
        }
     
        public PersPK getPersPK() {
            return persPK;
        }
     
        public void setPersPK(PersPK persPK) {
            this.persPK = persPK;
        }
     
        public String getSite() {
            return site;
        }
     
        public void setSite(String site) {
            this.site = site;
        }
     
        public String getCivilite() {
            return civilite;
        }
     
        public void setCivilite(String civilite) {
            this.civilite = civilite;
        }
     
        public String getNom() {
            return nom;
        }
     
        public void setNom(String nom) {
            this.nom = nom;
        }
     
        public String getPrenom() {
            return prenom;
        }
     
        public void setPrenom(String prenom) {
            this.prenom = prenom;
        }
     
        public String getGrade() {
            return grade;
        }
     
        public void setGrade(String grade) {
            this.grade = grade;
        }
     
        public Integer getAssurance() {
            return assurance;
        }
     
        public void setAssurance(Integer assurance) {
            this.assurance = assurance;
        }
     
        public String getMatricule() {
            return matricule;
        }
     
        public void setMatricule(String matricule) {
            this.matricule = matricule;
        }
     
        public String getMatriculeInterne() {
            return matriculeInterne;
        }
     
        public void setMatriculeInterne(String matriculeInterne) {
            this.matriculeInterne = matriculeInterne;
        }
     
        public String getCni() {
            return cni;
        }
     
        public void setCni(String cni) {
            this.cni = cni;
        }
     
        public String getDepartement() {
            return departement;
        }
     
        public void setDepartement(String departement) {
            this.departement = departement;
        }
     
        public String getDepartement1() {
            return departement1;
        }
     
        public void setDepartement1(String departement1) {
            this.departement1 = departement1;
        }
     
        public String getEmail() {
            return email;
        }
     
        public void setEmail(String email) {
            this.email = email;
        }
     
        public String getEmailProfessionnel() {
            return emailProfessionnel;
        }
     
        public void setEmailProfessionnel(String emailProfessionnel) {
            this.emailProfessionnel = emailProfessionnel;
        }
     
        public String getAgenceBanque() {
            return agenceBanque;
        }
     
        public void setAgenceBanque(String agenceBanque) {
            this.agenceBanque = agenceBanque;
        }
     
        public String getCodeBanque() {
            return codeBanque;
        }
     
        public void setCodeBanque(String codeBanque) {
            this.codeBanque = codeBanque;
        }
     
        public String getCodeGuichetBanque() {
            return codeGuichetBanque;
        }
     
        public void setCodeGuichetBanque(String codeGuichetBanque) {
            this.codeGuichetBanque = codeGuichetBanque;
        }
     
        public String getCodeSwiftBanque() {
            return codeSwiftBanque;
        }
     
        public void setCodeSwiftBanque(String codeSwiftBanque) {
            this.codeSwiftBanque = codeSwiftBanque;
        }
     
        public String getNumeroCompteBanque() {
            return numeroCompteBanque;
        }
     
        public void setNumeroCompteBanque(String numeroCompteBanque) {
            this.numeroCompteBanque = numeroCompteBanque;
        }
     
        public String getCleRibBanque() {
            return cleRibBanque;
        }
     
        public void setCleRibBanque(String cleRibBanque) {
            this.cleRibBanque = cleRibBanque;
        }
     
        public String getAgence() {
            return agence;
        }
     
        public void setAgence(String agence) {
            this.agence = agence;
        }
     
        public String getPhone() {
            return phone;
        }
     
        public void setPhone(String phone) {
            this.phone = phone;
        }
     
        public String getTelephoneProfessionnel() {
            return telephoneProfessionnel;
        }
     
        public void setTelephoneProfessionnel(String telephoneProfessionnel) {
            this.telephoneProfessionnel = telephoneProfessionnel;
        }
     
        public String getAdresse() {
            return adresse;
        }
     
        public void setAdresse(String adresse) {
            this.adresse = adresse;
        }
     
        public Integer getFoto() {
            return foto;
        }
     
        public void setFoto(Integer foto) {
            this.foto = foto;
        }
     
        public String getSignatureNumerique() {
            return signatureNumerique;
        }
     
        public void setSignatureNumerique(String signatureNumerique) {
            this.signatureNumerique = signatureNumerique;
        }
     
        public String getFingerPrint1() {
            return fingerPrint1;
        }
     
        public void setFingerPrint1(String fingerPrint1) {
            this.fingerPrint1 = fingerPrint1;
        }
     
        public String getFingerPrint2() {
            return fingerPrint2;
        }
     
        public void setFingerPrint2(String fingerPrint2) {
            this.fingerPrint2 = fingerPrint2;
        }
     
        public String getFingerPrint3() {
            return fingerPrint3;
        }
     
        public void setFingerPrint3(String fingerPrint3) {
            this.fingerPrint3 = fingerPrint3;
        }
     
        public String getFingerPrint4() {
            return fingerPrint4;
        }
     
        public void setFingerPrint4(String fingerPrint4) {
            this.fingerPrint4 = fingerPrint4;
        }
     
        public String getImage() {
            return image;
        }
     
        public void setImage(String image) {
            this.image = image;
        }
     
        public String getSignature() {
            return signature;
        }
     
        public void setSignature(String signature) {
            this.signature = signature;
        }
     
        public Integer getStatus() {
            return status;
        }
     
        public void setStatus(Integer status) {
            this.status = status;
        }
     
        public Integer getBadge() {
            return badge;
        }
     
        public void setBadge(Integer badge) {
            this.badge = badge;
        }
     
        public String getDnais() {
            return dnais;
        }
     
        public void setDnais(String dnais) {
            this.dnais = dnais;
        }
     
        public Integer getIDDateNaissance() {
            return iDDateNaissance;
        }
     
        public void setIDDateNaissance(Integer iDDateNaissance) {
            this.iDDateNaissance = iDDateNaissance;
        }
     
        public String getNpere() {
            return npere;
        }
     
        public void setNpere(String npere) {
            this.npere = npere;
        }
     
        public String getNmere() {
            return nmere;
        }
     
        public void setNmere(String nmere) {
            this.nmere = nmere;
        }
     
        public String getVnais() {
            return vnais;
        }
     
        public void setVnais(String vnais) {
            this.vnais = vnais;
        }
     
        public String getNurg() {
            return nurg;
        }
     
        public void setNurg(String nurg) {
            this.nurg = nurg;
        }
     
        public String getNuurg() {
            return nuurg;
        }
     
        public void setNuurg(String nuurg) {
            this.nuurg = nuurg;
        }
     
        public Integer getThreadindex() {
            return threadindex;
        }
     
        public void setThreadindex(Integer threadindex) {
            this.threadindex = threadindex;
        }
     
        public Integer getThreadindex1() {
            return threadindex1;
        }
     
        public void setThreadindex1(Integer threadindex1) {
            this.threadindex1 = threadindex1;
        }
     
        public Integer getLundi() {
            return lundi;
        }
     
        public void setLundi(Integer lundi) {
            this.lundi = lundi;
        }
     
        public Integer getMardi() {
            return mardi;
        }
     
        public void setMardi(Integer mardi) {
            this.mardi = mardi;
        }
     
        public Integer getMercredi() {
            return mercredi;
        }
     
        public void setMercredi(Integer mercredi) {
            this.mercredi = mercredi;
        }
     
        public Integer getJeudi() {
            return jeudi;
        }
     
        public void setJeudi(Integer jeudi) {
            this.jeudi = jeudi;
        }
     
        public Integer getVendredi() {
            return vendredi;
        }
     
        public void setVendredi(Integer vendredi) {
            this.vendredi = vendredi;
        }
     
        public Integer getSamedi() {
            return samedi;
        }
     
        public void setSamedi(Integer samedi) {
            this.samedi = samedi;
        }
     
        public Integer getDimanche() {
            return dimanche;
        }
     
        public void setDimanche(Integer dimanche) {
            this.dimanche = dimanche;
        }
     
        public Integer getVue() {
            return vue;
        }
     
        public void setVue(Integer vue) {
            this.vue = vue;
        }
     
        public Integer getSupp() {
            return supp;
        }
     
        public void setSupp(Integer supp) {
            this.supp = supp;
        }
     
        public Integer getModifPointage() {
            return modifPointage;
        }
     
        public void setModifPointage(Integer modifPointage) {
            this.modifPointage = modifPointage;
        }
     
        public Double getReccuperation() {
            return reccuperation;
        }
     
        public void setReccuperation(Double reccuperation) {
            this.reccuperation = reccuperation;
        }
     
        public String getCategorie() {
            return categorie;
        }
     
        public void setCategorie(String categorie) {
            this.categorie = categorie;
        }
     
        public String getEchelon() {
            return echelon;
        }
     
        public void setEchelon(String echelon) {
            this.echelon = echelon;
        }
     
        public Double getSalaireBaseMensuel() {
            return salaireBaseMensuel;
        }
     
        public void setSalaireBaseMensuel(Double salaireBaseMensuel) {
            this.salaireBaseMensuel = salaireBaseMensuel;
        }
     
        public Integer getTauxH() {
            return tauxH;
        }
     
        public void setTauxH(Integer tauxH) {
            this.tauxH = tauxH;
        }
     
        public Integer getHeuresHebdo() {
            return heuresHebdo;
        }
     
        public void setHeuresHebdo(Integer heuresHebdo) {
            this.heuresHebdo = heuresHebdo;
        }
     
        public String getLoge() {
            return loge;
        }
     
        public void setLoge(String loge) {
            this.loge = loge;
        }
     
        public String getNourri() {
            return nourri;
        }
     
        public void setNourri(String nourri) {
            this.nourri = nourri;
        }
     
        public String getGenreSalarie() {
            return genreSalarie;
        }
     
        public void setGenreSalarie(String genreSalarie) {
            this.genreSalarie = genreSalarie;
        }
     
        public String getDateEntree() {
            return dateEntree;
        }
     
        public void setDateEntree(String dateEntree) {
            this.dateEntree = dateEntree;
        }
     
        public String getDateContrat() {
            return dateContrat;
        }
     
        public void setDateContrat(String dateContrat) {
            this.dateContrat = dateContrat;
        }
     
        public String getTypeContrat() {
            return typeContrat;
        }
     
        public void setTypeContrat(String typeContrat) {
            this.typeContrat = typeContrat;
        }
     
        public String getDateSortie() {
            return dateSortie;
        }
     
        public void setDateSortie(String dateSortie) {
            this.dateSortie = dateSortie;
        }
     
        public String getMotifDepart() {
            return motifDepart;
        }
     
        public void setMotifDepart(String motifDepart) {
            this.motifDepart = motifDepart;
        }
     
        public String getMajconges() {
            return majconges;
        }
     
        public void setMajconges(String majconges) {
            this.majconges = majconges;
        }
     
        public Integer getArchive() {
            return archive;
        }
     
        public void setArchive(Integer archive) {
            this.archive = archive;
        }
     
        public Integer getAffichePlanning() {
            return affichePlanning;
        }
     
        public void setAffichePlanning(Integer affichePlanning) {
            this.affichePlanning = affichePlanning;
        }
     
        public Integer getSituationMatrimoniale() {
            return situationMatrimoniale;
        }
     
        public void setSituationMatrimoniale(Integer situationMatrimoniale) {
            this.situationMatrimoniale = situationMatrimoniale;
        }
     
        public Integer getNombreEnfant() {
            return nombreEnfant;
        }
     
        public void setNombreEnfant(Integer nombreEnfant) {
            this.nombreEnfant = nombreEnfant;
        }
     
        public String getPSeudo() {
            return pSeudo;
        }
     
        public void setPSeudo(String pSeudo) {
            this.pSeudo = pSeudo;
        }
     
        public Integer getSaisieTPV() {
            return saisieTPV;
        }
     
        public void setSaisieTPV(Integer saisieTPV) {
            this.saisieTPV = saisieTPV;
        }
     
        public Integer getEncaissementTPV() {
            return encaissementTPV;
        }
     
        public void setEncaissementTPV(Integer encaissementTPV) {
            this.encaissementTPV = encaissementTPV;
        }
     
        public String getSynchronization() {
            return synchronization;
        }
     
        public void setSynchronization(String synchronization) {
            this.synchronization = synchronization;
        }
     
        public Integer getNbMails() {
            return nbMails;
        }
     
        public void setNbMails(Integer nbMails) {
            this.nbMails = nbMails;
        }
     
        public Integer getNumeroOrdreSocial() {
            return numeroOrdreSocial;
        }
     
        public void setNumeroOrdreSocial(Integer numeroOrdreSocial) {
            this.numeroOrdreSocial = numeroOrdreSocial;
        }
     
        public String getLastUpDateTime() {
            return lastUpDateTime;
        }
     
        public void setLastUpDateTime(String lastUpDateTime) {
            this.lastUpDateTime = lastUpDateTime;
        }
     
        public Integer getIDLastUpDate() {
            return iDLastUpDate;
        }
     
        public void setIDLastUpDate(Integer iDLastUpDate) {
            this.iDLastUpDate = iDLastUpDate;
        }
     
        public String getCodeAgence() {
            return codeAgence;
        }
     
        public void setCodeAgence(String codeAgence) {
            this.codeAgence = codeAgence;
        }
     
        public String getCodeUtilisateur() {
            return codeUtilisateur;
        }
     
        public void setCodeUtilisateur(String codeUtilisateur) {
            this.codeUtilisateur = codeUtilisateur;
        }
     
        public String getDateTime() {
            return dateTime;
        }
     
        public void setDateTime(String dateTime) {
            this.dateTime = dateTime;
        }
     
        public String getNumeroSocial() {
            return numeroSocial;
        }
     
        public void setNumeroSocial(String numeroSocial) {
            this.numeroSocial = numeroSocial;
        }
     
        public String getIndexCarteAPuce() {
            return indexCarteAPuce;
        }
     
        public void setIndexCarteAPuce(String indexCarteAPuce) {
            this.indexCarteAPuce = indexCarteAPuce;
        }
     
        public String getIndexCompta() {
            return indexCompta;
        }
     
        public void setIndexCompta(String indexCompta) {
            this.indexCompta = indexCompta;
        }
     
        public String getIndexComptaAcompte() {
            return indexComptaAcompte;
        }
     
        public void setIndexComptaAcompte(String indexComptaAcompte) {
            this.indexComptaAcompte = indexComptaAcompte;
        }
     
        public String getIndexComptaOpposition() {
            return indexComptaOpposition;
        }
     
        public void setIndexComptaOpposition(String indexComptaOpposition) {
            this.indexComptaOpposition = indexComptaOpposition;
        }
     
        public Integer getPointagePC() {
            return pointagePC;
        }
     
        public void setPointagePC(Integer pointagePC) {
            this.pointagePC = pointagePC;
        }
     
        public Integer getConforme() {
            return conforme;
        }
     
        public void setConforme(Integer conforme) {
            this.conforme = conforme;
        }
     
        public Integer getIDDateTime() {
            return iDDateTime;
        }
     
        public void setIDDateTime(Integer iDDateTime) {
            this.iDDateTime = iDDateTime;
        }
     
        public Integer getArchiveIDDate() {
            return archiveIDDate;
        }
     
        public void setArchiveIDDate(Integer archiveIDDate) {
            this.archiveIDDate = archiveIDDate;
        }
     
        public String getArchiveDate() {
            return archiveDate;
        }
     
        public void setArchiveDate(String archiveDate) {
            this.archiveDate = archiveDate;
        }
     
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (persPK != null ? persPK.hashCode() : 0);
            return hash;
        }
     
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Pers)) {
                return false;
            }
            Pers other = (Pers) object;
            if ((this.persPK == null && other.persPK != null) || (this.persPK != null && !this.persPK.equals(other.persPK))) {
                return false;
            }
            return true;
        }
     
        @Override
        public String toString() {
            return "com.didier.jpa2.Pers[ persPK=" + persPK + " ]";
        }
     
     
    }
    et une classe représentant la clé primaire PersPK


    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
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package com.didier.jpa2;
     
    import java.io.Serializable;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Embeddable;
    import javax.validation.constraints.NotNull;
    import javax.validation.constraints.Size;
     
    /**
     *
     * @author IPPCDSI
     */
    @Embeddable
    public class PersPK implements Serializable {
        @Basic(optional = false)
        @Column(nullable = false)
        private int nEng;
        @Basic(optional = false)
        @NotNull
        @Size(min = 1, max = 50)
        @Column(nullable = false, length = 50)
        private String indexe;
     
        public PersPK() {
        }
     
        public PersPK(int nEng, String indexe) {
            this.nEng = nEng;
            this.indexe = indexe;
        }
     
        public int getNEng() {
            return nEng;
        }
     
        public void setNEng(int nEng) {
            this.nEng = nEng;
        }
     
        public String getIndexe() {
            return indexe;
        }
     
        public void setIndexe(String indexe) {
            this.indexe = indexe;
        }
     
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (int) nEng;
            hash += (indexe != null ? indexe.hashCode() : 0);
            return hash;
        }
     
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof PersPK)) {
                return false;
            }
            PersPK other = (PersPK) object;
            if (this.nEng != other.nEng) {
                return false;
            }
            if ((this.indexe == null && other.indexe != null) || (this.indexe != null && !this.indexe.equals(other.indexe))) {
                return false;
            }
            return true;
        }
     
        @Override
        public String toString() {
            return nEng + ":" + indexe;
        }
     
    }
    le problème survient souvent au niveau du converter que j'ai créé:

    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
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package converters;
     
    import com.didier.dao.UtilisateurSessionBean;
    import com.didier.jpa2.Pers;
    import com.didier.jpa2.PersPK;
    import javax.ejb.EJB;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import javax.faces.convert.FacesConverter;
     
    /**
     *
     * @author IPPCDSI
     */
    @FacesConverter(value = "persC")
    public class PersConverter implements Converter{
        @EJB
         UtilisateurSessionBean userFacade;
     
        private Pers maPersonne;
        private PersPK paPersonnePK;
     
         @Override
        public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) {
           if (submittedValue != null && !submittedValue.trim().isEmpty()){
     
             paPersonnePK = new PersPK();
             String[] vals = submittedValue.split(":");
             String val0 = vals[0];
             String val1 = vals[1];
             paPersonnePK.setNEng(Integer.parseInt(val0));
             paPersonnePK.setIndexe(val1);
               try {                
                  maPersonne =  userFacade.findPersbyPk(paPersonnePK);
    //              maPersonne = new Pers();
    //              maPersonne.setPersPK(paPersonnePK);
                   System.out.println(maPersonne);
                  return maPersonne;
     
                }catch(Exception e) {
                    throw new  ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Personne invalide"));
                }
            }
            else {
                return null;    
            }     
     
        }
     
        @Override
        public String getAsString(FacesContext context, UIComponent component, Object value) {
            if(value != null) {
     
                return String.valueOf(((Pers) value).getPersPK());
     
            }
            else {
                return null;
            }        
     
        }
    }

  16. #16
    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
    Le problème ne viens pas de ton code, mais de l'organisation des ClassLoader. Ta classe com.didier.jpa2.Pers est présente pour une raison à déterminer dans deux classloader différents.

  17. #17
    Nouveau membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2013
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2013
    Messages : 41
    Points : 27
    Points
    27
    Par défaut
    D'accord Tchize j'essaye de déboguer comme vous avez indiqué plus haut...

Discussions similaires

  1. [MPD] Quand utiliser plusieurs bases de données ?
    Par remy67 dans le forum Schéma
    Réponses: 2
    Dernier message: 11/05/2014, 22h57
  2. [2.x] Comment utiliser plusieures bases de données?
    Par green29 dans le forum Symfony
    Réponses: 3
    Dernier message: 23/07/2013, 11h36
  3. [ZF 1.9] Utiliser plusieurs bases de données dans l'adapter
    Par Aure7780 dans le forum Zend_Db
    Réponses: 1
    Dernier message: 17/11/2009, 09h42
  4. Requête utilisant plusieurs bases de données
    Par GodGives dans le forum Langage SQL
    Réponses: 9
    Dernier message: 10/06/2008, 13h43

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