java - 春袋鼠 : JDBC driver not available for 'org.h2.Driver'

标签 java spring jdbc spring-roo h2

我在 Ubuntu Linux、Spring Tools 2.7.1、Spring Roo 1.1.5 上运行 Eclipse Indigo。我正在阅读 Getting Started with Roo当我尝试数据库逆向工程时出现以下错误:

roo> database reverse engineer --schema ROO_CRM --package org.obliquid.crm.domain
Located add-on that may offer this JDBC driver
 1 found, sorted by rank; T = trusted developer; R = Roo 1.1 compatible
ID T R DESCRIPTION -------------------------------------------------------------
01 Y Y 1.3.159.0001 H2 #jdbcdriver driverclass:org.h2.Driver. This bundle...
--------------------------------------------------------------------------------
[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
JDBC driver not available for 'org.h2.Driver'

但是,即使我尝试

roo> addon install id --searchResultId 01

再次运行逆向工程师会导致同样的错误。在我的 pom.xml 中我也有这个依赖:

<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <version>1.3.155</version>
    <classifier />
</dependency>

如何化解僵局?

更新:在我随后的测试中,我将数据库转换为 MySQL,虽然在 eclipse 中它仍然无法工作,但在独立的 roo shell 中它可以工作。但是,我现在在家,而今天我在工作,所以这也可能是网络问题。我怀疑它现在也适用于 H2。

roo> addon install id --searchResultId 1
Target resource(s):
------------------                                                     
   Spring Roo - Wrapping - mysql-connector-java (5.1.17.0020)

Required resource(s):  
---------------------                                                    
   slf4j-api (1.6.1)                     
   slf4j-nop (1.6.1)       

Deploying...done.                                                    

Successfully installed add-on: Spring Roo - Wrapping - mysql-connector-java [version: 5.1.17.0020] 
[Hint] Please consider rating this add-on with the following command:                                                                         
[Hint] addon feedback bundle --bundleSymbolicName org.springframework.roo.wrapping.mysql-connector-java --rating ... --comment "..."    

更新 2:再次针对另一个示例项目,逆向工程师在独立 shell 中工作,但没有在 Eclipse 中工作。所以现在我的解决方法是在独立的 roo shell 中进行问题逆向工程。

最佳答案

请检查您的 Eclipse 网络设置。如果您在代理服务器后面,通常会出现问题。

关于java - 春袋鼠 : JDBC driver not available for 'org.h2.Driver' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7321908/

相关文章:

mysql - 在 Spring Boot 中动态向 MySQL 添加新列

Java SQL 数据库独立性

java - 如何将十六进制字符串存储在 android 中的整数变量中???

java - 带有 Keycloak 的 Spring 应用程序返回 401 错误

spring - 包名不包含 ObjectFactory.class 或 jaxb.in​​dex

java - 使用 POI 将大型结果集写入 Excel 文件

java - 关闭 jdbc 结果集的最佳实践

java - GWT vs Flex vs?

java - 使用 Luke 的 Lucene 中出现 "<field> indexed without position data"错误的原因是什么?

java - Android - 在不长按(选择)TextView 时单击 TextView