【问题标题】:Spring Roo MySQL JDBC DriverSpring Roo MySQL JDBC 驱动程序
【发布时间】:2012-07-16 13:43:23
【问题描述】:

我正在尝试在 Spring Roo 中安装 MySQL JDBC 驱动程序。这是日志:

roo> addon search --requiresDescription "#jdbcdriver,driverclass:com.mysql.jdbc.Driver"
0 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
ID T R DESCRIPTION -------------------------------------------------------------
--------------------------------------------------------------------------------
[HINT] use 'addon info id --searchResultId ..' to see details about a search result
[HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
[HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version

我该怎么办?

【问题讨论】:

    标签: java mysql spring-roo


    【解决方案1】:

    在 Spring Roo 1.2.5.RELEASE 中,似乎存在一个错误。 add on 命令显示 MySQL 驱动程序已成功安装,但运行 DBRE 命令失败且未找到驱动程序。

    对于这个版本的 Roo,我也有其他人抱怨这个问题。

    解决这个问题的唯一方法是手动将 MySQL 驱动程序 (JAR) 复制到 /spring-roo-1.2.5.RELEASE/bundle 文件夹并重新启动 Spring STS,这是我运行 Roo 的位置。

    这行得通;希望这对同一条船上的人有所帮助。

    【讨论】:

      【解决方案2】:

      告诉 roo 安装 jdbc-drive 试试这个:

      roo> addon search jdbc
      9 found, sorted by rank; T = trusted developer; R = Roo 1.2 compatible
      ID T R DESCRIPTION -------------------------------------------------------------
      01 Y Y 1.2.4.0010 #jdbcdriver driverclass:net.sourceforge.jtds.jdbc.Driver.
             This bundle wraps the standard Maven artifact: jtds-1.2.4.
      02 Y Y 5.1.18.0001 #jdbcdriver driverclass:com.mysql.jdbc.Driver. This bundle
             wraps the standard Maven artifact: mysql-connector-java-5.1.18.
      03 Y Y 10.8.2.2_0001 Derby Client #jdbcdriver
             driverclass:org.apache.derby.jdbc.ClientDriver. This bundle wraps the...
      04 Y Y 6.7.0.0010 #jdbcdriver driverclass:com.ibm.as400.access.AS400JDBCDriver.
             This bundle wraps the standard Maven artifact: jtopen-6.7.
      05 Y Y 10.8.2.2_0001 Derby #jdbcdriver
             driverclass:org.apache.derby.jdbc.EmbeddedDriver. This bundle wraps...
      06 Y Y 9.1.0.901-1_0001 Postgres #jdbcdriver driverclass:org.postgresql.Driver.
             This bundle wraps the standard Maven artifact:...
      07 Y Y 9.1.0.901_0001 Postgres #jdbcdriver driverclass:org.postgresql.Driver.
             This bundle wraps the standard Maven artifact:...
      08 Y Y 1.3.170.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle wraps
             the standard Maven artifact: h2-1.3.170.
      09 Y Y 2.1.6.0020 #jdbcdriver driverclass:org.firebirdsql.jdbc.FBDriver. This
             bundle wraps the standard Maven artifact: firebird-2.1.6.
      --------------------------------------------------------------------------------
      [HINT] use 'addon info id --searchResultId ..' to see details about a search result
      [HINT] use 'addon install id --searchResultId ..' to install a specific search result, or
      [HINT] use 'addon install bundle --bundleSymbolicName TAB' to install a specific add-on version
      roo> addon install id --searchResultId 02
      

      ID就是列表中的Id...

      【讨论】:

        【解决方案3】:

        如果你只是想添加驱动,你可以直接在 pom.xml 中添加,例如

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.21</version>
        </dependency>
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-09-10
          • 2016-03-27
          • 2014-10-24
          • 1970-01-01
          相关资源
          最近更新 更多