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 Discussion :

Problème avec la base de données H2


Sujet :

Java

  1. #1
    Membre éclairé
    Femme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

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

    Informations forums :
    Inscription : Mai 2013
    Messages : 464
    Par défaut Problème avec la base de données H2
    Salut les dévelppeurs , je suis en détresse, j'ai conçu une application de gestion medical en java en utilisant H2 pour le cousin, il l'utilise depuis fin de l'année 2017 sans soucis. Suite a une couppure d'electricité il n'arrive pas et s'y connecter . Je commence à penser à une saturation de H2 , j'ai exceuter son .jar en cmd et voici l'erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    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
     
     
    C:\GestionORL>java -jar Med_ORL.jar
    oct. 19, 2020 4:09:19 PM vues.Authentification jButton3ActionPerformed
    GRAVE: null
    org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: rowCou
    nt expected 10933 got 10934 T24.I25" [50000-176]
            at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
            at org.h2.message.DbException.get(DbException.java:167)
            at org.h2.message.DbException.convert(DbException.java:294)
            at org.h2.table.RegularTable.addRow(RegularTable.java:138)
            at org.h2.store.PageStore.redo(PageStore.java:1575)
            at org.h2.store.PageLog.recover(PageLog.java:329)
            at org.h2.store.PageStore.recover(PageStore.java:1407)
            at org.h2.store.PageStore.openExisting(PageStore.java:368)
            at org.h2.store.PageStore.open(PageStore.java:289)
            at org.h2.engine.Database.getPageStore(Database.java:2366)
            at org.h2.engine.Database.open(Database.java:657)
            at org.h2.engine.Database.openDatabase(Database.java:260)
            at org.h2.engine.Database.<init>(Database.java:254)
            at org.h2.engine.Engine.openSession(Engine.java:57)
            at org.h2.engine.Engine.openSession(Engine.java:164)
            at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
            at org.h2.engine.Engine.createSession(Engine.java:125)
            at org.h2.engine.Engine.createSession(Engine.java:27)
            at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav
    a:331)
            at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
            at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
            at org.h2.Driver.connect(Driver.java:74)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at vues.Authentification.jButton3ActionPerformed(Authentification.java:2
    47)
            at vues.Authentification.access$400(Authentification.java:31)
            at vues.Authentification$5.actionPerformed(Authentification.java:129)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
            at java.awt.Container.processEvent(Unknown Source)
            at java.awt.Component.dispatchEventImpl(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Window.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
            at java.awt.EventQueue.access$500(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: rowCount expected 10933 got 10934 T24.I25
     
            at org.h2.message.DbException.throwInternalError(DbException.java:241)
            at org.h2.table.RegularTable.checkRowCount(RegularTable.java:170)
            at org.h2.table.RegularTable.addRow(RegularTable.java:121)
            ... 59 more
     
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at vues.Authentification.jButton3ActionPerformed(Authentification.java:2
    56)
            at vues.Authentification.access$400(Authentification.java:31)
            at vues.Authentification$5.actionPerformed(Authentification.java:129)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
            at java.awt.Container.processEvent(Unknown Source)
            at java.awt.Component.dispatchEventImpl(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Window.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
            at java.awt.EventQueue.access$500(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
    rivilege(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    Quelqu'un aurait une idée sur la résolution de ce problème? c'est urgent je creuse entre temps sur google

  2. #2
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 583
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 583
    Par défaut
    Salut,

    Je pense que ta base de données est corrompu, test ça https://h2database.com/javadoc/org/h...s/Recover.html

  3. #3
    Membre éclairé
    Femme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

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

    Informations forums :
    Inscription : Mai 2013
    Messages : 464
    Par défaut
    Merci pour la réponse, mais est ce que vous pouvez m'indiquer comment utiliser ses methodes? je ne comprend pas sur son PC il'ya le jar et la base , je dois toucher au projet original et envoyer un nouveau jar ou comment y remedier? puis est ce qu'"il a perdu ses données??

  4. #4
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 583
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 583
    Par défaut
    google est ton amis https://stackoverflow.com/questions/...no-h2-database Tu dois l'utiliser via la ligne de commande.

  5. #5
    Membre éclairé
    Femme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

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

    Informations forums :
    Inscription : Mai 2013
    Messages : 464
    Par défaut
    Mlaheureusement quand je tente de créer mon script j'obtient la meme erreur cité si-dessus, je crois l'avoir perdu :'(

  6. #6
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 583
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 583
    Par défaut
    As tu run la commande? C'est curieux que tu es la même erreur https://github.com/nyg/h2-recover
    Tu ne fais pas de backup?

  7. #7
    Membre éclairé
    Femme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

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

    Informations forums :
    Inscription : Mai 2013
    Messages : 464
    Par défaut
    ouii meme ce bout de code je l'ai essayé toujours la meme erreur c'est ce qui me fait perdre espoir toutes les solutions proposées me menent vers la meme exception :/
    pour le backup une autre histoire il ne detecte pas ma bdd (nommée BDH22) pourtant elle est bel et bien la, ps: j'ai essayé BDH22 et aussi BDH22.h2.db (avec extention) toujours la meme chose :'(

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    No database files have been found in directory C:/Users/Mediastore/Desktop/Mohamed/src/BD for the database ~/Desktop/Mohamed/src/BD/BDH22

  8. #8
    Membre Expert

    Homme Profil pro
    développeur
    Inscrit en
    Octobre 2013
    Messages
    1 583
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : développeur

    Informations forums :
    Inscription : Octobre 2013
    Messages : 1 583
    Par défaut
    https://www.tutorialspoint.com/h2_da...ase_backup.htm Un autre lien pour le backup, ton backup n'est pas un zip?

  9. #9
    Membre éclairé
    Femme Profil pro
    Étudiant
    Inscrit en
    Mai 2013
    Messages
    464
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Algérie

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

    Informations forums :
    Inscription : Mai 2013
    Messages : 464
    Par défaut
    la solution était autour de moi, j'ai restauré une ancienne version de la BDD grâce à windows , pour ceux qui rencontrent ce problème, pensez à faire ça avant d'aller aux solutions poussées et fatigantes

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

Discussions similaires

  1. Réponses: 8
    Dernier message: 11/10/2006, 17h28
  2. [VB]Problème avec les bases de données
    Par boudincweole10 dans le forum VB 6 et antérieur
    Réponses: 9
    Dernier message: 22/04/2006, 20h24
  3. problème avec ma base de donnée
    Par polace dans le forum PostgreSQL
    Réponses: 7
    Dernier message: 22/10/2005, 22h26
  4. problème avec ma base de données
    Par pmboutteau dans le forum ASP
    Réponses: 6
    Dernier message: 25/02/2005, 12h59

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