2012-07-16 108 views
1

我試圖在Spring Roo中安裝MySQL JDBC驅動程序。這裏是日誌: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 

我該怎麼辦?

回答

1

如果您只是想添加驅動程序,您可以直接將其添加到pom.xml中,例如

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

告訴袋鼠安裝JDBC驅動試試這個:

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列表...

6

在Spring Roo的1.2.5.RELEASE,似乎有一個錯誤。 add on命令顯示MySQL驅動程序已成功安裝,但運行DBRE命令失敗且未找到驅動程序。

我也有其他人抱怨這個問題,以及這個版本的Roo。

唯一能解決這個問題的方法是手動將MySQL驅動程序(JAR)複製到/spring-roo-1.2.5.RELEASE/bundle文件夾中,然後重新啓動Spring STS,這是我運行Roo的地方。

工作;希望這可以幫助同舟共濟的人。