1 Reply Latest reply on Mar 16, 2007 3:33 AM by Jerry Kurian

    Unable to connect to Mysql for generate-entities

    Jerry Kurian Newbie

      I am trying to generate entities using the seamgen and used the seam setup to set the properties

      The build.properties under seam-gen folder looks like

      #Fri Mar 16 05:56:11 IST 2007
      hibernate.connection.password=jerry
      workspace.home=C\:/Projects
      model.package=com.sample.mpdel
      driver.jar=C\:/tools/mysql/mysql-connector-java-5.0.5/mysql-connector-java-5.0.5-bin.jar
      action.package=com.sample.services
      test.package=com.sample.services.test
      database.type=mysql
      hibernate.default_catalog.null=
      database.drop=n
      hibernate.default_schema.null=
      project.name=Sample
      hibernate.connection.username=jerry
      hibernate.connection.driver_class=com.mysql.jdbc.Driver
      project.type=ear
      database.exists=y
      jboss.home=C\:/jboss/jboss-4.0.5.GA
      hibernate.dialect=org.hibernate.dialect.MySQLDialect
      hibernate.connection.url=jdbc\:mysql\://sample
      

      But when i run the generate-entitites, i get the following exception


      [hibernate] org.hibernate.exception.JDBCConnectionException: Getting database me
      tadata
      [hibernate] java.sql.SQLException: No suitable driver
      
      BUILD FAILED
      C:\jboss\jboss-seam-1.2.0.PATCH1\seam-gen\build.xml:805: org.hibernate.exception
      .JDBCConnectionException: Getting database metadata
       at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToo
      lTask.java:223)
       at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
      va:186)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.Target.execute(Target.java:341)
       at org.apache.tools.ant.Target.performTasks(Target.java:369)
       at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
       at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
      cutor.java:40)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
       at org.apache.tools.ant.Main.runBuild(Main.java:668)
       at org.apache.tools.ant.Main.startAnt(Main.java:187)
       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      Caused by: org.hibernate.exception.JDBCConnectionException: Getting database met
      adata
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
      ava:74)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(
      AbstractMetaDataDialect.java:62)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearc
      h(AbstractMetaDataDialect.java:157)
       at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMe
      taDataDialect.java:22)
       at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:446
      )
       at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.jav
      a:73)
       at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.jav
      a:828)
       at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:118)
       at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
       at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaData
      Configuration.java:40)
       at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConf
      igurationTask.java:82)
       at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(Configurati
      onTask.java:55)
       at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateTo
      olTask.java:299)
       at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolT
      ask.java:315)
       at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.ja
      va:94)
       at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2Jav
      aExporterTask.java:34)
       at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
       at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
      va:183)
       ... 12 more
      Caused by: java.sql.SQLException: No suitable driver
       at java.sql.DriverManager.getConnection(Unknown Source)
       at java.sql.DriverManager.getConnection(Unknown Source)
       at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
      n(DriverManagerConnectionProvider.java:110)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getConnectio
      n(AbstractMetaDataDialect.java:120)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(
      AbstractMetaDataDialect.java:59)
       ... 28 more
      --- Nested Exception ---
      org.hibernate.exception.JDBCConnectionException: Getting database metadata
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
      ava:74)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.getMetaData(
      AbstractMetaDataDialect.java:62)
       at org.hibernate.cfg.reveng.dialect.AbstractMetaDataDialect.caseForSearc
      h(AbstractMetaDataDialect.java:157)
       at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMe
      taDataDialect.java:22)
       at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:446
      )
       at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.jav
      a:73)
       at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.jav
      a:828)
       at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:118)
       at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
       at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaData
      Configuration.java:40)
      


      I am using mysql DB 5.0.18 and from the properties it does look like i have given the proper path to the driver.

      Any help would be greatly appreciated.

      thanks,
      Jerry