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

Outils MySQL Discussion :

Problème avec hibernate et MySQL!


Sujet :

Outils MySQL

  1. #1
    Membre habitué Avatar de sofien
    Inscrit en
    Février 2005
    Messages
    325
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Février 2005
    Messages : 325
    Points : 127
    Points
    127
    Par défaut Problème avec hibernate et MySQL!
    Bonjour,

    Mon problème est que je ne peux pas me connecter à ma base de données sous MySQL avec hibernate .J'ai le stacktrace suivant :
    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
     
    15 août 2008 12:28:05 org.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 3.2.4.sp1
    15 août 2008 12:28:05 org.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    15 août 2008 12:28:05 org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: Bytecode provider name : cglib
    15 août 2008 12:28:05 org.hibernate.cfg.Environment <clinit>
    INFO: using JDK 1.4 java.sql.Timestamp handling
    15 août 2008 12:28:05 org.hibernate.cfg.Configuration configure
    INFO: configuring from resource: /hibernate.cfg.xml
    15 août 2008 12:28:05 org.hibernate.cfg.Configuration getConfigurationInputStream
    INFO: Configuration resource: /hibernate.cfg.xml
    15 août 2008 12:28:06 org.hibernate.cfg.Configuration addResource
    INFO: Reading mappings from resource : com/dao/FBEleve/Eleve.hbm.xml
    15 août 2008 12:28:06 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: com.dao.FBEleve.Eleve -> fb_eleves
    15 août 2008 12:28:06 org.hibernate.cfg.Configuration doConfigure
    INFO: Configured SessionFactory: null
    15 août 2008 12:28:06 org.hibernate.connection.C3P0ConnectionProvider configure
    INFO: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://172.16.0.43:3306/test"
    15 août 2008 12:28:06 org.hibernate.connection.C3P0ConnectionProvider configure
    INFO: Connection properties: {user=sofien, password=****}
    15 août 2008 12:28:06 org.hibernate.connection.C3P0ConnectionProvider configure
    INFO: autocommit mode: false
    15 août 2008 12:28:07 com.mchange.v2.log.MLog <clinit>
    INFO: MLog clients using java 1.4+ standard logging.
    15 août 2008 12:28:07 com.mchange.v2.c3p0.C3P0Registry banner
    INFO: Initializing c3p0-0.9.0 [built 11-July-2005 00:43:29 -0400; debug? true; trace: 10]
    15 août 2008 12:28:07 com.mchange.v2.c3p0.PoolBackedDataSource getPoolManager
    INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@13c1b02 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1507fb2 [ acquireIncrement -> 5, acquireRetryAttempts -> 100, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1507fb2, idleConnectionTestPeriod -> 1000, initialPoolSize -> 5, maxIdleTime -> 300, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@edc3a2 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> edc3a2, jdbcUrl -> jdbc:mysql://172.16.0.43:3306/test", properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 13c1b02, numHelperThreads -> 3 ]
    15 août 2008 12:29:47 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
    ATTENTION: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@ec4a87 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (100).
    15 août 2008 12:29:47 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
    ATTENTION: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1d64c37 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (100).
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    ATTENTION: Could not obtain connection metadata
    java.sql.SQLException: Connections could not be acquired from the underlying database!
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)
    at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
    at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
    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 persistence.HibernateUtil.<clinit>(HibernateUtil.java:15)
    Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
    at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
    ... 6 more
    15 août 2008 12:29:47 org.hibernate.dialect.Dialect <init>
    INFO: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
    15 août 2008 12:29:47 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Using default transaction strategy (direct JDBC transactions)
    15 août 2008 12:29:47 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic flush during beforeCompletion(): disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic session close at end of transaction: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Scrollable result sets: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC3 getGeneratedKeys(): disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Connection release mode: auto
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Maximum outer join fetch depth: 2
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default batch fetch size: 1
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Generate SQL with comments: enabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL updates by primary key: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL inserts for batching: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    15 août 2008 12:29:47 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    INFO: Using ASTQueryTranslatorFactory
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JPA-QL strict compliance: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Second-level cache: enabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query cache: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory createCacheProvider
    INFO: Cache provider: org.hibernate.cache.NoCacheProvider
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Structured second-level cache entries: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Statistics: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Deleted entity synthetic identifier rollback: disabled
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default entity-mode: pojo
    15 août 2008 12:29:47 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Named query checking : enabled
    15 août 2008 12:29:48 org.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    15 août 2008 12:29:48 org.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    15 août 2008 12:29:53 org.hibernate.impl.SessionFactoryImpl close
    INFO: closing
    Comme le montre le text en gras, je ne peux pas avoir de connexion à la base de données.

    voici mon fichier hibernate.cfg.xml :
    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
     
    <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration
    PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
     
    <hibernate-configuration>
    <session-factory>
    <!-- JDBC connection to Oracle
    <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1522:test</property>
    <property name="hibernate.connection.username">test</property>
    <property name="hibernate.connection.password">test</property>-->
     
    <!-- JDBC connection to MySQL -->
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://172.16.0.43:3306/test"</property>
    <property name="hibernate.connection.username">sofien</property>
    <property name="hibernate.connection.password">mysql</property>
     
    <!-- Common parameters -->
    <property name="hibernate.c3p0.min_size">5</property>
    <property name="hibernate.c3p0.max_size">20</property>
    <property name="hibernate.c3p0.timeout">300</property>
    <property name="hibernate.c3p0.max_statements">50</property>
    <property name="hibernate.c3p0.idle_test_period">1000</property>
    <property name="hibernate.c3p0.acquire_increment">5</property>
    <property name="hibernate.c3p0.acquireRetryAttempts">60</property>
     
    <!-- SQL to stdout logging -->
    <property name="show_sql">false</property>
    <property name="format_sql">false</property>
    <property name="use_sql_comments">true</property>
    <!-- <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>-->
    <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
     
    <!-- <mapping resource="hello/Message.hbm.xml"/>-->
    <!-- <mapping resource="com/dao/eleve/Eleve.hbm.xml"/>-->
    <mapping resource="com/dao/FBEleve/Eleve.hbm.xml"/>
    <!-- <mapping resource="com/dao/eleve/Eleve_s.hbm.xml"/>-->
    </session-factory>
    </hibernate-configuration>
    Merci de m'aider !
    La vie n'est qu'une suite de tests...(pas unitaires )

  2. #2
    Membre chevronné Avatar de guigui5931
    Profil pro
    Chef de projet NTIC
    Inscrit en
    Avril 2006
    Messages
    1 667
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2006
    Messages : 1 667
    Points : 2 232
    Points
    2 232
    Par défaut
    Il faut que tu mette en commentaire la partie de ton fichier de config qui correspond à Oracle à mon avis.
    autant l'hiver éclate que l'hétéroclite
    le vrai geek c'est celui qui croit qu'il y a 1024 mètres dans un kilomètre

  3. #3
    Membre habitué Avatar de sofien
    Inscrit en
    Février 2005
    Messages
    325
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Février 2005
    Messages : 325
    Points : 127
    Points
    127
    Par défaut
    Citation Envoyé par guigui5931 Voir le message
    Il faut que tu mette en commentaire la partie de ton fichier de config qui correspond à Oracle à mon avis.
    Elle l'est déja

    <!-- plusieurs lignes-->
    La vie n'est qu'une suite de tests...(pas unitaires )

  4. #4
    Membre éprouvé
    Avatar de Sivrît
    Profil pro
    Inscrit en
    Février 2006
    Messages
    953
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Février 2006
    Messages : 953
    Points : 1 249
    Points
    1 249
    Par défaut
    La coloration syntaxique du forum a repéré un truc intéressant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <property name="hibernate.connection.url">jdbc:mysql://172.16.0.43:3306/test"</property>
    << test" >> c'est pas banal comme login.

  5. #5
    Membre habitué Avatar de sofien
    Inscrit en
    Février 2005
    Messages
    325
    Détails du profil
    Informations personnelles :
    Âge : 42

    Informations forums :
    Inscription : Février 2005
    Messages : 325
    Points : 127
    Points
    127
    Par défaut
    Citation Envoyé par Sivrît Voir le message
    La coloration syntaxique du forum a repéré un truc intéressant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <property name="hibernate.connection.url">jdbc:mysql://172.16.0.43:3306/test"</property>
    << test" >> c'est pas banal comme login.
    En fait ce n'était pas l'erreur mais bon...j'ai déja résolu le problème...
    La vie n'est qu'une suite de tests...(pas unitaires )

  6. #6
    Membre expert
    Avatar de Emmanuel Lecoester
    Profil pro
    Inscrit en
    Février 2003
    Messages
    1 493
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Février 2003
    Messages : 1 493
    Points : 3 266
    Points
    3 266
    Par défaut
    Peut-on connaitre la solution ?
    Emmanuel Lecoester
    => joomla addict.

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

Discussions similaires

  1. Problème avec dbExpress et Mysql (dbexpmysql.dll?)
    Par tipiweb dans le forum Bases de données
    Réponses: 4
    Dernier message: 31/01/2006, 17h46
  2. Problème avec select sous MYSQL
    Par Thomad dans le forum Langage SQL
    Réponses: 2
    Dernier message: 26/01/2006, 12h26
  3. Petit problème avec vb6 et mysql
    Par AsmCode dans le forum SQL Procédural
    Réponses: 2
    Dernier message: 05/01/2006, 05h44
  4. Problèmes avec INTERSECT sur MYSQL
    Par zarbydigital dans le forum Requêtes
    Réponses: 1
    Dernier message: 27/09/2005, 14h18
  5. Problème avec mon service mysql et PhpMyAdmin
    Par Fixazo dans le forum Outils
    Réponses: 1
    Dernier message: 28/08/2005, 19h02

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