我正在使用一个名为dbmapper的工具来生成域类。我们已经根据tool.This is my class所需的规则创建了我们的db
public class Test {
public static void main(String args[]){
GenerateConfig gc = new GenerateConfig();
String driverClassName = "com.mysql.jdbc.Driver";
String dbURL = "jdbc:mysql://localhost:3306/temp1";
String username = "root";
String password = "root";
String destDirectory = "F:\\target";
String type = "jpa";
gc.setDriver(driverClassName);
gc.setUrl(dbURL);
gc.setUser(username);
gc.setPassword(password);
gc.setDestinationDirectory(destDirectory);
gc.setType(type);
Generator g = new Generator();
g.setConfig(gc);
try {
g.generate();
} catch (Exception e) {
e.printStackTrace();
}
}
}当我运行这个类时,我得到了以下异常。
org.apache.velocity.exception.ResourceNotFoundException:找不到资源'com/moonspider/dbmap/jpa.template‘
我的类路径中有必要的jar文件。我还尝试使用了几个ResourceLoader实现,但都出现了相同的错误。
有人能帮帮我吗?
谢谢
发布于 2011-01-14 15:38:57
看起来您的源包com/moonspider/dbmap下缺少一个名为jpa.template的文件。
https://stackoverflow.com/questions/4688821
复制相似问题