Bonjour,
J'ai développé un EJB assez simple pour m'entraîner. J'ai créé un client de test pour voir si j'arrive bien a accéder aux méthodes distantes et ça marche.
J'ai voulu par exemple afficher le nombre d'utilisateur de la base de donnée.
Voici deux méthodes partagée côté EJB:
J'arrive à afficher le nombre d'utilisateurs côté client (93 utilisateurs) en appelant hello() mais je n'arrive pas avoir la liste complète en appelant getAllUtilisateurs().
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 public String hello() { return("il y a "+getAllUtilisateurs().size()+" utilisateurs"); } public List<Utilisateur> getAllUtilisateurs() { System.out.println("demande de récupération des utilisateurs"); try { Query query = getEm().createQuery("SELECT u FROM Utilisateur u"); return query.getResultList(); } catch(Throwable th) { throw new VisionException("marde"); } }
Voici mon exception:
Je me demande si ce n'est pas la taille des données à transporter de l'EJB au client.
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 24 juil. 2009 10:15:58 com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 readRMIIIOPValueType ATTENTION: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream" org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe at com.sun.corba.ee.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:8428) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:973) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974) at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:896) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:466) at com.sun.corba.ee.impl.corba.TCUtility.unmarshalIn(TCUtility.java:296) at com.sun.corba.ee.impl.corba.AnyImpl.read_value(AnyImpl.java:610) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:748) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_any(CDRInputStream.java:406) at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.readAny(Util.java:504) at com.sun.corba.ee.impl.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:690) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:359) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1974) at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2199) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1211) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:422) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:368) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:466) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:195) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152) at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225) at vision.dao.__IDaoRemote_Remote_DynamicStub.getAllUtilisateur(vision/dao/__IDaoRemote_Remote_DynamicStub.java) at vision.dao._IDaoRemote_Wrapper.getAllUtilisateur(vision/dao/_IDaoRemote_Wrapper.java) at TestDao.test1(TestDao.java:40) at TestDao.main(TestDao.java:55) Caused by: java.io.IOException: Mismatched serialization UIDs : Source (Rep. IDRMI:oracle.toplink.essentials.indirection.IndirectList:C736541957C385C5:7070E88CAC21B40B) = 7070E88CAC21B40B whereas Target (Rep. ID RMI:oracle.toplink.essentials.indirection.IndirectList:C736541957C385C5:8CE233D0CA77EED4) = 8CE233D0CA77EED4 at com.sun.corba.ee.impl.util.RepositoryId.useFullValueDescription(RepositoryId.java:650) at com.sun.corba.ee.impl.io.ValueHandlerImpl.useFullValueDescription(ValueHandlerImpl.java:420) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:419) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:362) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:328) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966) ... 41 more
Help!!
Merci beaucoup
Partager