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

NetBeans Java Discussion :

[NBP]NetBeans Platform - ModuleInstall - Hibernate


Sujet :

NetBeans Java

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut [NBP]NetBeans Platform - ModuleInstall - Hibernate
    Bonjour à tous,

    Comme je l'avais expliqué dans un autre post, j'utilise NetBeans Platform avec Hibernate 3 (dans un library wrapper).
    L'initialisation de la base de données (Derby en embedded) est relativement longue, j'ai donc décidé de l'initialiser au chargement
    de mon appli avec un Installer qui hérite de ModuleInstall.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    public class Installer extends ModuleInstall {
     
        public static Configuration configuration;
        public static SessionFactory sessionFactory;
     
        public void restored() {
            configuration = new Configuration().configure(); 
            sessionFactory = configuration.buildSessionFactory();
            }
    }
    La configuration se passe a priori sans problème, mais au moment du buildSessionFactory, une exception est générée :

    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.sql.SQLException: Failed to start database 'mabase', see the next exception for details.
            at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
            at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
            at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
            at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:525)
            at java.sql.DriverManager.getConnection(DriverManager.java:140)
            at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
            at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
            at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
            at org.myorg.monapp.Installer.restored(Installer.java:23)
    Je ne comprends pas en quoi cela pose problème...
    Est-ce du au fait que tous les modules n'aient pas encore été initialisés ? Si oui pourquoi la configuration marche t'elle ?

    D'avance, merci !

    Arnaud

  2. #2
    Membre éprouvé
    Avatar de n!co
    Profil pro
    Inscrit en
    Février 2004
    Messages
    831
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 831
    Points : 936
    Points
    936
    Par défaut
    Salut,

    Failed to start database 'mabase', see the next exception for details.
    Et c'est quoi l'exception suivante ? ca pourrait beaucoup nous aider a resoudre ton probleme

    Sinon, je l'ai fait avec une base mysql sans problème, par contre c'est spring qui initialisait la session factory.
    Sinon ne déclares pas ta variable en static. Tu ferais mieux de créer une classe a part sur le principe de singleton, ca serait bien plus propre.

    n!co
    Netbeans account : nico@share.java.net
    Merci de ne pas poser de questions techniques par MP

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut
    Merci pour ta réponse.

    Il m'affiche simplement la même exception deux fois ...

    Par contre, j'ai remarqué que cela pose un problème lorsque j'exécute mon projet à l'intérieur de NetBeans. Mais lorsque que je créée un .zip et que je exécute en dehors de l'IDE, le problème n'est visiblement plus présent...

  4. #4
    Membre éprouvé
    Avatar de n!co
    Profil pro
    Inscrit en
    Février 2004
    Messages
    831
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 831
    Points : 936
    Points
    936
    Par défaut
    La seule chose que je peux voir comme ca alors c'est un problème de dependance entre tes modules.
    Sinon sans plus d'info, difficile de t'apporter un aide ...

    n!co
    Netbeans account : nico@share.java.net
    Merci de ne pas poser de questions techniques par MP

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut
    Re,

    Je vais essayer d'être plus précis. Mon application est décomposé en plusieurs modules. Un module contenant la librairie Derby.
    Un module contenant l'ensemble des librairies utiles à Hibernate et possédant une dépendance vis-à-vis du module contenant Derby. Ce module "Hibernate" contient les librairies suivantes :
    - ant
    - antlr
    - asm
    - cglib
    - commons collections
    - commons logging
    - dom4j
    - log4j
    - ehcache
    - hibernate3
    - jta

    Lorsque je construit le module Hibernate, il apparait bien des warnings au sujets de problèmes d'accès entre différentes classes, mais je pense qu'ils n'influent pas sur le bon fonctionnement dans mon cas (malgré leur grand nombre )

    Le problème que j'ai est que je cherche à configurer et initialiser la connexion avec la base de données pendant le démarrage de l'application. Ensuite, lorsque l'utilisateur a besoin d'une session, j'effectue simplement un openSession sur le sessionFactory.

    Ce qui m'embete vraiment, c'est que tout marche parfaitement lorsque je configure et initialise la connexion à la base de données en dehors de ma classe héritant de ModuleInstall. Lorsque cette initialisation est faite dans mon Installer, l'exception indiquée dans mon premier post est générée.

    Je ne sais pas si j'ai été plus précis ... je ne vois pas trop quoi ajouter ...

  6. #6
    Membre éprouvé
    Avatar de n!co
    Profil pro
    Inscrit en
    Février 2004
    Messages
    831
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 831
    Points : 936
    Points
    936
    Par défaut
    Ton ModuleInstall se trouve dans quel module ?
    Tu as gardé ton système de variable static pour stocker ta sessionFactory ?
    Netbeans account : nico@share.java.net
    Merci de ne pas poser de questions techniques par MP

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut
    Oups...
    J'ai oublié de dire que tout ce qui concerne mon code à proprement dit est placé dans un 3° module. Mon ModuleInstall est placé dans ce module. Ce 3° module dépend du module Derby et du module Hibernate.
    J'ai un peu changé mon principe d'initialisation :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    public class Installer extends ModuleInstall {
            public void restored() {
                  DBUtil.initializeDB();      
        }
    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
     
    public class DBUtil {
            private static SessionFactory sessionFactory;
            private static Configuration configuration; 
     
     
            public static void initializeDB(){
                if (configuration == null)
                    configuration = new Configuration().configure();  
     
                if(sessionFactory == null)  
                    sessionFactory = configuration.buildSessionFactory();
            }
     
            public static Session createSession(){
                return sessionFactory.openSession();
            }
    C'est pas forcément mieux qu'avant ...

  8. #8
    Membre éprouvé
    Avatar de n!co
    Profil pro
    Inscrit en
    Février 2004
    Messages
    831
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 831
    Points : 936
    Points
    936
    Par défaut
    Oui ton utilisation de static n'est pas d'une tres bonne pratique.
    J'aurais fait quelques chose du genre :
    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
    public class DBUtil {
    	private SessionFactory sessionFactory;
            private Configuration configuration; 
     
    	// L'instance unique de DBUtil
    	private static DBUtil instance;
     
    	// Interdiction d'instancier directement la classe
    	private DBUtil() {}
     
    	// Récupération de l'instance unique de DBUtil
    	public DBUtil getInstance() {
    		if( instance == null )
    			instance = new DBUtil();
     
    		return instance;
    	}
     
            private void initializeDB(){
                if (configuration == null)
                    configuration = new Configuration().configure();  
     
                if(sessionFactory == null)  
                    sessionFactory = configuration.buildSessionFactory();
            }
     
            public Session createSession(){
                return sessionFactory.openSession();
            }
    }
    Ensuite il faudra commencer par récupérer l'instance de ta classe via getInstance() et ensuite appeler les méthodes. Enfin pas sur que ca change qqs chose a ton problème, mais c'est plus design.

    QUand tu dis que ca fonctionne en dehors de netbeans, ca veut dire quand tu executes la plateforme en standalone, sans passer par run ?

    Sinon, tu devrais avoir un log complet dans /build/testuserdir/var/log/message.log
    Netbeans account : nico@share.java.net
    Merci de ne pas poser de questions techniques par MP

  9. #9
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut
    J'ai utilisé ta méthode pour l'instanciation et l'accès aux méthodes, c'est vrai que c'est beaucoup plus propre mais cela ne résoud pas mon problème.
    Quand je dis que j'ai lancé l'application en dehors de netbeans, c'est que j'ai crée une distribution .zip et que je l'ai exécuté par un double clic. L'appli tourne donc en Standalone.

    Pouor en revenir à une exécution au sein de NB (par clic sur 'run'), j'ai d'un coté une exception dans la console, mais j'ai beau regarder le log je ne vois rien ...
    Log:
    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
     
    -------------------------------------------------------------------------------
    >Log Session: Thursday, April 26, 2007 2:34:13 PM CEST
    >System Info: 
      Product Version         = Myapp Application 200612070100
      Operating System        = Windows XP version 5.1 running on x86
      Java; VM; Vendor; Home  = 1.5.0_11; Java HotSpot(TM) Client VM 1.5.0_11-b03; Sun Microsystems Inc.; C:\Program Files\Java\jdk1.5.0_11\jre
      System Locale; Encoding = fr_FR (myapp); Cp1252
      Home Dir.; Current Dir. = C:\Documents and Settings\moi; D:\Mes documents\NetBeans files\MyappApp\Myapp
      Installation; User Dir. = D:\Mes documents\NetBeans files\MyappApp\build\cluster;C:\Program Files\netbeans-5.5\platform6; D:\Mes documents\NetBeans files\MyappApp\build\testuserdir
      Boot & Ext. Classpath   = C:\Program Files\Java\jdk1.5.0_11\jre\lib\rt.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\i18n.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\jce.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.5.0_11\jre\classes;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\sunpkcs11.jar
      Application Classpath   = C:\Program Files\netbeans-5.5\platform6\lib\boot.jar;C:\Program Files\netbeans-5.5\platform6\lib\org-openide-modules.jar;C:\Program Files\netbeans-5.5\platform6\lib\org-openide-util.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\boot_ja.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\boot_pt_BR.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\boot_zh_CN.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-modules_ja.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-modules_pt_BR.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-modules_zh_CN.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-util_ja.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-util_pt_BR.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\org-openide-util_zh_CN.jar;C:\Program Files\netbeans-5.5\platform6\lib\locale\swing-l10n_pt_BR.jar;C:\Program Files\Java\jdk1.5.0_11\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_11\lib\tools.jar
      Startup Classpath       = C:\Program Files\netbeans-5.5\platform6\core\core.jar;C:\Program Files\netbeans-5.5\platform6\core\org-openide-filesystems.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\core_ja.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\core_pt_BR.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\core_zh_CN.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\org-openide-filesystems_ja.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\org-openide-filesystems_pt_BR.jar;C:\Program Files\netbeans-5.5\platform6\core\locale\org-openide-filesystems_zh_CN.jar;D:\Mes documents\NetBeans files\MyappApp\build\cluster\core\locale\core_myapp.jar
    -------------------------------------------------------------------------------
    You are trying to access file: log4j.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: log4j.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: log4j.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.cfg.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Client.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: CommandeClient.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Devis.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Article.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: LigneCommande.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    Turning on modules:
    	org.openide.util [6.8.22 200612070100]
    	org.openide.modules [6.5.22 200612070100]
    	org.openide.options [6.4.22 200612070100]
    	com.toedter.plaf [1.0 070426]
    	org.openide.awt [6.7.22 200612070100]
    	org.openide.dialogs [6.5.22 200612070100]
    	org.openide.nodes [6.7.22 200612070100]
    	org.openide.windows [6.5.22 200612070100]
    	org.netbeans.swing.tabcontrol [1.6.22 200612070100]
    	org.apache.derby [1.0 070426]
    	org.hibernate [1.0 070426]
    	org.jdesktop.layout/1 [1.3.23 1.0 200612070100]
    	org.myorg.myapp [1.0 070426]
    	org.openide.filesystems [6.4.22 200612070100]
    	org.openide.text [6.9.22 200612070100]
    	org.openide.explorer [6.5.22 1 200612070100]
    	org.openide.actions [6.5.22 200612070100]
    	org.openide.loaders [5.9.22 200612070100]
    	org.netbeans.bootstrap/1 [2.3.22 200612070100]
    	org.netbeans.core.startup/1 [1.5.22 200612070100]
    	org.netbeans.modules.queries/1 [1.7.22 200612070100]
    	org.netbeans.modules.favorites/1 [1.11.23 200612070100]
    	org.netbeans.swing.plaf [1.5.22 200612070100]
    	org.netbeans.core/2 [3.2.22.1 200612070100]
    	org.netbeans.modules.settings/1 [1.10.33 200612070100]
    	org.netbeans.api.progress/1 [1.5.22 200612070100]
    	org.netbeans.modules.autoupdate/1 [2.16.22 200612070100]
    	org.myorg.updatecenter [1.0 070426]
    	org.netbeans.core.windows/2 [2.7.22.1 200612070100]
    	org.netbeans.core.ui/1 [1.9.22 200612070100]
    	org.netbeans.modules.masterfs/1 [1.8.24 200612070100]
    	org.netbeans.modules.javahelp/1 [2.8.22 200612070100]
    	org.myorg.myapphelp [1.0 070426]
    Deploying test module D:\Mes documents\NetBeans files\MyappApp\build\cluster\modules\org-myorg-myapp.jar...
    Disabling StandardModule:org.myorg.myapp jarFile: D:\Mes documents\NetBeans files\MyappApp\build\cluster\modules\org-myorg-myapp.jar...
    Turning off modules:
    	org.myorg.myapp [1.0 070426]
    	org.jdesktop.layout/1 [1.3.23 1.0 200612070100]
    	org.hibernate [1.0 070426]
    	org.apache.derby [1.0 070426]
    	com.toedter.plaf [1.0 070426]
    Enabling StandardModule:org.myorg.myapp jarFile: D:\Mes documents\NetBeans files\MyappApp\build\cluster\modules\org-myorg-myapp.jar...
    Installing new module: Myapp
    You are trying to access file: log4j.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: log4j.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: log4j.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.properties from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: hibernate.cfg.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Client.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: CommandeClient.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Devis.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: Article.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    You are trying to access file: LigneCommande.hbm.xml from the default package.
    Please see http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/classpath.html#default_package
    Turning on modules:
    	org.apache.derby [1.0 070426]
    	org.hibernate [1.0 070426]
    	org.jdesktop.layout/1 [1.3.23 1.0 200612070100]
    	com.toedter.plaf [1.0 070426]
    	org.myorg.myapp [1.0 070426]
    Done.

    Console:
    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
    java.sql.SQLException: Failed to start database 'mabase', see the next exception for details.
            at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
            at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
            at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
            at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:525)
            at java.sql.DriverManager.getConnection(DriverManager.java:140)
            at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
            at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
            at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
            at org.myorg.myapp.DBUtil.initializeDB(DBUtil.java:32)
            at org.myorg.myapp.Installer.restored(Installer.java:27)
            at org.openide.modules.ModuleInstall.installed(ModuleInstall.java:81)
            at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:371)
            at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:282)
            at org.netbeans.ModuleManager.enable(ModuleManager.java:904)
            at org.netbeans.ModuleManager.enable(ModuleManager.java:710)
            at org.netbeans.core.startup.ModuleSystem.deployTestModule(ModuleSystem.java:334)
            at org.netbeans.core.startup.TestModuleDeployer.deployTestModule(TestModuleDeployer.java:46)
            at org.netbeans.core.startup.CLITestModuleReload.cli(CLITestModuleReload.java:53)
            at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:182)
            at org.netbeans.CLIHandler.access$000(CLIHandler.java:49)
            at org.netbeans.CLIHandler$1.exec(CLIHandler.java:503)
            at org.netbeans.CLIHandler.finishInitialization(CLIHandler.java:352)
            at org.netbeans.Main.finishInitialization(Main.java:196)
            at org.netbeans.core.NonGui.run(NonGui.java:142)
            at org.netbeans.core.startup.Main.start(Main.java:401)
            at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:96)
            at java.lang.Thread.run(Thread.java:595)
    14:34:21,197  INFO Dialect:152 - Using dialect: org.hibernate.dialect.DerbyDialect
    14:34:21,213  INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
    14:34:21,213  INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    14:34:21,213  INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
    14:34:21,213  INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
    14:34:21,275  INFO SettingsFactory:162 - Scrollable result sets: disabled
    14:34:21,275  INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): disabled
    14:34:21,275  INFO SettingsFactory:178 - Connection release mode: auto
    14:34:21,275  INFO SettingsFactory:205 - Default batch fetch size: 1
    14:34:21,291  INFO SettingsFactory:209 - Generate SQL with comments: disabled
    14:34:21,291  INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
    14:34:21,291  INFO SettingsFactory:382 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    14:34:21,291  INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
    14:34:21,291  INFO SettingsFactory:221 - Query language substitutions: {}
    14:34:21,291  INFO SettingsFactory:226 - JPA-QL strict compliance: disabled
    14:34:21,291  INFO SettingsFactory:231 - Second-level cache: enabled
    14:34:21,291  INFO SettingsFactory:235 - Query cache: disabled
    14:34:21,291  INFO SettingsFactory:369 - Cache provider: org.hibernate.cache.NoCacheProvider
    14:34:21,291  INFO SettingsFactory:250 - Optimize cache for minimal puts: disabled
    14:34:21,291  INFO SettingsFactory:259 - Structured second-level cache entries: disabled
    14:34:21,307  INFO SettingsFactory:286 - Statistics: disabled
    14:34:21,307  INFO SettingsFactory:290 - Deleted entity synthetic identifier rollback: disabled
    14:34:21,307  INFO SettingsFactory:305 - Default entity-mode: pojo
    14:34:21,307  INFO SettingsFactory:309 - Named query checking : enabled
    14:34:21,338  INFO SessionFactoryImpl:161 - building session factory
    14:34:21,932  INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
    14:34:21,947  INFO SchemaUpdate:115 - Running hbm2ddl schema update
    14:34:21,947  INFO SchemaUpdate:126 - fetching database metadata
    14:34:21,947 ERROR SchemaUpdate:134 - could not get database metadata
    java.sql.SQLException: Failed to start database 'mabase', see the next exception for details.        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
            at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
            at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
            at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:525)
            at java.sql.DriverManager.getConnection(DriverManager.java:140)
            at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
            at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:27)
            at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:127)
            at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
            at org.myorg.myapp.DBUtil.initializeDB(DBUtil.java:32)
            at org.myorg.myapp.Installer.restored(Installer.java:27)
            at org.openide.modules.ModuleInstall.installed(ModuleInstall.java:81)
            at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:371)
            at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:282)
            at org.netbeans.ModuleManager.enable(ModuleManager.java:904)
            at org.netbeans.ModuleManager.enable(ModuleManager.java:710)
            at org.netbeans.core.startup.ModuleSystem.deployTestModule(ModuleSystem.java:334)
            at org.netbeans.core.startup.TestModuleDeployer.deployTestModule(TestModuleDeployer.java:46)
            at org.netbeans.core.startup.CLITestModuleReload.cli(CLITestModuleReload.java:53)
            at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:182)
            at org.netbeans.CLIHandler.access$000(CLIHandler.java:49)
            at org.netbeans.CLIHandler$1.exec(CLIHandler.java:503)
            at org.netbeans.CLIHandler.finishInitialization(CLIHandler.java:352)
            at org.netbeans.Main.finishInitialization(Main.java:196)
            at org.netbeans.core.NonGui.run(NonGui.java:142)
            at org.netbeans.core.startup.Main.start(Main.java:401)
            at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:96)
            at java.lang.Thread.run(Thread.java:595)
    14:34:21,947 ERROR SchemaUpdate:165 - could not complete schema update
    java.sql.SQLException: Failed to start database 'mabase', see the next exception for details.        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
            at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
            at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
            at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
            at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:525)
    Merci pour ton aide en tout cas

  10. #10
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2007
    Messages : 22
    Points : 17
    Points
    17
    Par défaut
    Bonjour à tous !

    J'ai une interrogation par rapport à mon problème.
    Je le répète, quand je clique sur l'icone 'play' de mon projet (touche f6) l'erreur que j'ai décrite se produit. Mais je viens de remarquer que lorsque je fait un clic droit sur le projet puis que je clique sur 'Run Project' il n'y a plus de problème ... plus d'exception générée ...
    Je ne comprends pas du tout ce qui se passe ... est-ce que ce genre de problème est déjà arrivé à quelqu'un ? SiI oui comment y remédier ?

    Merci d'avance

Discussions similaires

  1. Utilisation de Hibernate dans NetBeans Platform
    Par Mustick dans le forum NetBeans Platform
    Réponses: 4
    Dernier message: 06/10/2011, 12h59
  2. Netbeans Platform et Hibernate
    Par aяиaud dans le forum NetBeans
    Réponses: 4
    Dernier message: 11/04/2007, 15h18
  3. Réponses: 2
    Dernier message: 25/03/2006, 18h54
  4. Réponses: 1
    Dernier message: 24/03/2006, 16h32
  5. Réponses: 2
    Dernier message: 09/12/2005, 22h40

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