I am using a tool called dbmapper to generate domain classes. We have created our db in accordance with the rules required for this tool.This is my class
开发者_如何学编程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();
}
}
}
When I run this class I get the following exception.
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'com/moonspider/dbmap/jpa.template'
I have the necessary jar files in my classpath. I also tried using a couple of ResourceLoader implementations but igt the same error.
Could somebody help me here?
Thanks
It seems that you are missing a file called jpa.template
under your source package com/moonspider/dbmap
.
精彩评论