Results 1 to 3 of 3

Thread: Cannot create PoolableConnectionFactory

  1. #1
    Join Date
    May 2012
    Posts
    16

    Default Cannot create PoolableConnectionFactory

    Hi,

    I have a MavenWebapplication in netbeans and when I run my project I have the following error:

    Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'Futurefruit')
    The name of my table is FutureFruit.

    In my Application-Context I checked my url and it's correct

    Here my Application-context

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
                               http://www.springframework.org/schema/beans/spring-beans.xsd
                               http://www.springframework.org/schema/context
                               http://www.springframework.org/schema/context/spring-context.xsd
                               http://www.springframework.org/schema/tx
                               http://www.springframework.org/schema/tx/spring-tx.xsd">
    
      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
       <property name="driverClassName" value="com.mysql.jdbc.Driver" />
       <property name="url" value="jdbc:mysql://127.0.0.1/Futurefruit" />
       <property name="username" value="root" />
       <property name="password" value="" />
       <property name="initialSize" value="5" />
       <property name="maxActive" value="10" />
      </bean>
    
      <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="annotatedClasses">
          <list>
            <value>be.hubrussel.futurefruit.domain.Probleem</value>
          </list>
        </property>
        <property name="hibernateProperties">
          <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
          </props>
        </property>
      </bean>
      
      <bean id="probleemDao" class="be.hubrussel.futurefruit.dao.ProbleemHibernateDao" >
        <property name="sessionFactory" ref="sessionFactory" />
      </bean>
      
      <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
      </bean>
    
      <tx:annotation-driven transaction-manager="transactionManager"/>
    
      <bean id="futurefruitSessieService" class="be.hubrussel.futurefruit.service.FuturefruitSessieServiceImpl">
        <property name="probleemDao" ref="probleemDao" />
      </bean>
      
     
    
    </beans>
    Is there another class in my project to check for my connection ?
    In my url I changed localhost to 127.0.0 but still have the same error ...
    thnx!

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    Have you READ the stacktrace?

    Code:
    Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'Futurefruit')
    It is nice that you have a table called Futurefruit but that isn't the name of your database that contains the table...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    May 2012
    Posts
    16

    Default

    Hey MArten,

    I found my problem The name of my database is FutureFruit and not 'Futurefruit' it made a mistake.

    So problen solved thnx fr yr relpy!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •