1 Reply Latest reply on Jan 13, 2010 11:42 AM by Pedro Araújo

    Hibernate + MySQL problem

    Pedro Araújo Newbie

      Hi guys,

       

      I've deployed Hibernate + MySQL bundles and all related dependencies from Spring Bundle Repository in Fuse ESB 4.1.0.2.

       

      These two:

      JBoss Hibernate Object-Relational Mapper (3.3.2.GA)

      MySQL AB's JDBC Driver for MySQL (5.1.6)

       

      I've created a bundle that its just a simple Spring application with a DAO class just to access the database via hibernate template. Everything works fine when i deploy it into Fuse ESB, the status of the bundle is "Active" and Spring is "Started", but i get this error in log file:

       

      14:50:33,056 | INFO  | xtenderThread-76 | HbmBinder                      |org.hibernate.cfg.HbmBinder       322 | Mapping class: com.bosch.seppo.hibernateTeste.model.Product -> Product

      14:50:33,057 | INFO  | xtenderThread-76 | LocalSessionFactoryBean          | bernate3.LocalSessionFactoryBean  730 | Building new Hibernate SessionFactory

      14:50:33,057 | INFO  | xtenderThread-76 | ConnectionProviderFactory        | ection.ConnectionProviderFactory   95 | Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider

      14:50:33,058 | WARN  | xtenderThread-76 | JDBCExceptionReporter            | rnate.util.JDBCExceptionReporter  100 | SQL Error: 0, SQLState: 08001

      14:50:33,059 | ERROR | xtenderThread-76 | JDBCExceptionReporter            | rnate.util.JDBCExceptionReporter  101 | No suitable driver found for jdbc:mysql://10.32.6.53:3306/seppo

      14:50:33,059 | WARN  | xtenderThread-76 | SettingsFactory                  | rg.hibernate.cfg.SettingsFactory  133 | Could not obtain connection to query metadata

      java.sql.SQLException: No suitable driver found for jdbc:mysql://10.32.6.53:3306/seppo

      at java.sql.DriverManager.getConnection(DriverManager.java:602)

      at java.sql.DriverManager.getConnection(DriverManager.java:154)

      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)

      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)

      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)

      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)

      at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)

      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)

      at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)

      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)

      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)

      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)

      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)

      at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

      at java.security.AccessController.doPrivileged(Native Method)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

      at java.security.AccessController.doPrivileged(Native Method)

       

      In pom.xml i have:

       

       

             <property name="driverClassName" value="com.mysql.jdbc.Driver"/>

             <property name="url" value="jdbc:mysql://10.32.6.53:3306/seppo"/>

              

       

      when i try to persist something in the database i get the same type of error because JDBC connection can't be established... it's missing the driver? how is that possible?

       

      I'm doing something wrong? I'm missing something?

      Can anyone help me please?

       

      Regards,

       

      Pedro Araújo

       

      Edited by: pedroprodigy on Jan 12, 2010 3:15 PM

       

      Edited by: pedroprodigy on Jan 12, 2010 3:19 PM

       

      Edited by: pedroprodigy on Jan 12, 2010 3:19 PM