Announcement Announcement Module
Collapse
No announcement yet.
Cannot create PoolableConnectionFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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...

    Comment


    • #3
      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!

      Comment

      Working...
      X