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

JPA Java Discussion :

Problème EJB JPA persistance méthode persist


Sujet :

JPA Java

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut Problème EJB JPA persistance méthode persist
    Bonjour à tous,
    J'essaye tout simplement d'insérer un objet dans une table nommé "personnes" avec persist de JPA. L'erreur vient lors de l'invocation du persit de mon OJB local "personServiceLocal".

    Mon erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Infos: file:/C:/Users/Bastien/Documents/NetBeansProjects/test/dist/gfdeploy/test/test-ejb_jar/-test-ejbPU login successful
    Avertissement: A system exception occurred during an invocation on EJB personService method public void facade.personService.create(classes.personnes)
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
    Code client main :

    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
    public class Main {
        @EJB
        private static hellotestRemote hellotest;
     
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            System.out.println(hellotest.sayhello());
            System.out.println("ça commence");
     
            //System.out.println(hellotest.createNewPerson("BONHOURE", "Bastien"));
            hellotest.createNewPerson("BONHOURE", "Bastien");
     
            System.out.println("c'est fini");
        }
    }
    Code EJB stateless (hellotest) :

    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
    @Stateless
    public class hellotest implements hellotestRemote {
     
        @EJB
        private personServiceLocal personService;
     
        @Override
        public String sayhello() {
            return "exars";
        }
     
        @Override
        public void createNewPerson(String nom, String prenom) {
     
            personnes person = new personnes();
            person.setNom(nom);
            person.setPrenom(prenom);
     
            personService.create(person);
     
        }
     
    }
    Code EJB local (personService) :

    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
    @Stateless(name="personService")
    @TransactionManagement(TransactionManagementType.CONTAINER)
    //@TransactionAttribute(TransactionAttributeType.MANDATORY)
    public class personService implements personServiceLocal {
     
     
        @PersistenceContext(unitName="test-ejbPU")
        private EntityManager em;
     
     
        @Override
        @TransactionAttribute(value=TransactionAttributeType.REQUIRED)
        public void create(personnes person) {
            em.persist(person);
            //System.out.println("la sauce");
        }
     
    }
    Code persistence.xml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="test-ejbPU" transaction-type="JTA">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <jta-data-source>jdbc/wsdbPool</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
        </properties>
      </persistence-unit>
    </persistence>

  2. #2
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Il faut que tu trouve la trace correspondant a l'exception :
    Avertissement: A system exception occurred during an invocation on EJB personService method public void facade.personService.create(classes.personnes)
    Et poste le code de ta classe Personne et la structure de la table correspondante.

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    Voici ma classe :

    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
    @Entity
    @Table(name = "personnes")
    public class personnes implements Serializable {
     
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name="id_person", nullable=false)
        private long id;
        @Column(name="nom")
        private String nom;
        @Column(name="prenom")
        private String prenom;
     
        public long getId() {
            return id;
        }
     
        public void setId(long id) {
            this.id = id;
        }
     
        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;
        } 
     
    }

  4. #4
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Et l'exception ?
    Ton mapping correspond-t-il bien à ta base de données?

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    Je ne comprend pas ou trouver cette exception ??

    Par contre quand je mon pool de connexion ping bien.

  6. #6
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Quel serveur d'application utilises-tu ?

  7. #7
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    Glasshfish 3.1

    Merci de prendre de ton temps.
    En faisant un simple clean and build, je n'ai plus cette erreur.

    J'en est une autre maintenant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Avertissement: PER01000: Got SQLException executing statement "CREATE TABLE personnes (id_person BIGINT NOT NULL, nom VARCHAR(255), prenom VARCHAR(255), PRIMARY KEY (id_person))": java.sql.SQLException: No database selected
    Avertissement: PER01000: Got SQLException executing statement "CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(38), PRIMARY KEY (SEQ_NAME))": java.sql.SQLException: No database selected
    Avertissement: PER01000: Got SQLException executing statement "INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN', 1)": java.sql.SQLException: No database selected
    No database selected, alors que mon jndi est le bon dans mon fichier persistence et mon persistencecontext est le bon.

  8. #8
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Alors j'ai eu le même problème il n'y a pas longtemps.

    Dans ton pool de connexions, il faut bien remplir toutes les propriétés nécessaires à ton driver. Elles peuvent être différentes de celles proposées par défaut à la création. J'en avais oublié, (databaseName entre autre). Le ping fonctionnait mais j'avais l'erreur "java.sql.SQLException: No database selected".


    Tu utilises MySQL ?


    Dans glassfish les fichiers de logs se trouvent dans le dossier log de ton domaine.

  9. #9
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Une annotation @EJB dans un programme autonome ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  10. #10
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745

  11. #11
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    On avance petit à petit, il me fallait remplir les champs "URL" et "Url" ds les propriétés de mon pool et mettre : "jdbc:mysql://localhost:3306/nomdelabase".

    Oui j'utilise mysql.

    Nouvelle erreur :
    Lors du run, quand je commente
    Pas d'erreur, et quand je le dé-commente,
    Le run-single me génère ceci :
    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
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:601)
    	at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:438)
    	at org.glassfish.appclient.client.AppClientFacade.main(AppClientFacade.java:165)
    Caused by: javax.ejb.EJBException: java.rmi.RemoteException: CORBA NO_IMPLEMENT 1398079489 Maybe; nested exception is: 
    	org.omg.CORBA.NO_IMPLEMENT: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.NO_IMPLEMENT: Avertissement: IOP01000001: Missing local value implementation  vmcid: SUN  minor code: 1 completed: Maybe
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    	at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
    	at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
    	at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
    	at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
    ....
    ....
    Et l'onglet de glasshfish :
    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
    Exception [TOPLINK-4011] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Exception Description: Error preallocating sequence numbers.  The sequence table information is not complete.
    	at oracle.toplink.essentials.exceptions.DatabaseException.errorPreallocatingSequenceNumbers(DatabaseException.java:152)
    	at oracle.toplink.essentials.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:98)
    	at oracle.toplink.essentials.sequencing.DefaultSequence.getGeneratedVector(DefaultSequence.java:168)
    	at oracle.toplink.essentials.sequencing.Sequence.getGeneratedVector(Sequence.java:281)
    	at oracle.toplink.essentials.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:420)
    	at oracle.toplink.essentials.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:848)
    	at oracle.toplink.essentials.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:110)
    	at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:240)
    	at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:355)
    	at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:3260)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:339)
    	at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3220)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:205)
    	at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:269)
    	at facade.gestionPersonnes.createPersonne(gestionPersonnes.java:34)
    ...
    ...

  12. #12
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    The sequence table information is not complete
    Apparement il attends une séquence dans la table qui va bien du fait que tu utilises :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    @GeneratedValue(strategy = GenerationType.AUTO)

    Si ton champs est de type auto_increment dans mysql il faut utiliser :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    @GeneratedValue(strategy = GenerationType.IDENTITY)

    ==> JavaDoc

  13. #13
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    Bon super, un petit clean and build puis un changement de AUTO en IDENTITY et ça m'insère bien mon objet ds la base !

    Mais j'ai toujours une erreur même si ça marche :
    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
    Avertissement: LDR5207: ASURLClassLoader EarLibClassLoader : 
    doneCalled = true
    doneSnapshot = ASURLClassLoader.done() called ON EarLibClassLoader : 
    urlSet = [URLEntry : file:/C:/Users/Bastien/Documents/NetBeansProjects/projetJAVA/proj/dist/gfdeploy/proj/lib/proj-common.jar, URLEntry : file:/C:/Users/Bastien/Documents/NetBeansProjects/projetJAVA/proj/dist/gfdeploy/proj/lib/test-common.jar, URLEntry : file:/C:/Users/Bastien/Documents/NetBeansProjects/projetJAVA/proj/dist/gfdeploy/proj/lib/toplink-essentials-agent.jar, URLEntry : file:/C:/Users/Bastien/Documents/NetBeansProjects/projetJAVA/proj/dist/gfdeploy/proj/lib/toplink-essentials.jar]
    doneCalled = false 
     Parent -> org.glassfish.internal.api.DelegatingClassLoader@6bdfe124
     AT Fri Dec 02 10:07:43 CET 2011 
     BY :java.lang.Throwable: printStackTraceToString
    	at com.sun.enterprise.util.Print.printStackTraceToString(Print.java:639)
    	at com.sun.enterprise.loader.ASURLClassLoader.done(ASURLClassLoader.java:211)
    	at com.sun.enterprise.loader.ASURLClassLoader.preDestroy(ASURLClassLoader.java:179)
    	at org.glassfish.javaee.full.deployment.EarClassLoader.preDestroy(EarClassLoader.java:114)
    	at org.glassfish.internal.data.ApplicationInfo.unload(ApplicationInfo.java:355)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:1000)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1025)
    	at org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:330)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:722)
     Parent -> org.glassfish.internal.api.DelegatingClassLoader@6bdfe124
     was requested to find class oracle.toplink.essentials.tools.sessionmanagement.SessionManager after done was invoked from the following stack trace
    java.lang.Throwable
    	at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:780)
    	at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:152)
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:1147)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:107)
    	at org.glassfish.persistence.jpa.JPADeployer.closeEMFs(JPADeployer.java:405)
    	at org.glassfish.persistence.jpa.JPADeployer.event(JPADeployer.java:396)
    	at org.glassfish.kernel.event.EventsImpl$1.run(EventsImpl.java:120)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:722)
     
    Avertissement: Exception while dispatching an event
    java.lang.NoClassDefFoundError: oracle/toplink/essentials/tools/sessionmanagement/SessionManager
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:152)
    	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:1147)
    	at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:107)
    	at org.glassfish.persistence.jpa.JPADeployer.closeEMFs(JPADeployer.java:405)
    	at org.glassfish.persistence.jpa.JPADeployer.event(JPADeployer.java:396)
    	at org.glassfish.kernel.event.EventsImpl$1.run(EventsImpl.java:120)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassNotFoundException: oracle.toplink.essentials.tools.sessionmanagement.SessionManager
    	at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:782)
    	at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    	... 12 more
    Est-ce normal ?

    Merci bcp de votre aide

  14. #14
    Membre expérimenté
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2004
    Messages
    1 184
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

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

    Informations forums :
    Inscription : Avril 2004
    Messages : 1 184
    Points : 1 745
    Points
    1 745
    Par défaut
    Toplink n'est plus l'implémentation de JPA dans glassfish 3.1.
    As-tu bien mis tous les jars dans le dossier lib de GlassFish ?

    J'ai trouvé ce lien : http://docs.oracle.com/html/E25034_01/tlandgs.htm

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

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

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Points : 3 938
    Points
    3 938
    Par défaut
    Le causedBy te dit qu'il te manque ce jar
    Vous avez peut être hâte de réussir et il n'y a rien de mal à cela...
    mais la patience est aussi une vertu; l'échec vous l'enseignera certainement..."

  16. #16
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2010
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2010
    Messages : 13
    Points : 6
    Points
    6
    Par défaut
    Je n'avais mis que "mysql-connector-java-5.1.18-bin.jar"
    Merci pour toutes ces réponses !!

Discussions similaires

  1. Méthode persist avec JPA + EJB + JSF
    Par electronnne dans le forum JPA
    Réponses: 0
    Dernier message: 27/05/2012, 17h17
  2. [EJB JPA] Impossible d'utiliser la persistence
    Par ramoucho75020 dans le forum JPA
    Réponses: 1
    Dernier message: 30/03/2012, 14h34
  3. Réponses: 1
    Dernier message: 21/12/2011, 10h18
  4. Réponses: 4
    Dernier message: 13/05/2009, 15h04
  5. [EJB2.1 Entity] comment configurer un conteneur EJb pour gérer la persistance des CMP
    Par berrehouma dans le forum Java EE
    Réponses: 1
    Dernier message: 06/04/2007, 10h08

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