New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hibernate files loading from nonexistent file names #54
Comments
This code fragment looks promising for finding files under the tomcat extraction directory. ClassLoader classLoader = getClass().getClassLoader();
File inputFile = new File(classLoader.getResource("admin/resources/dbInfo.csv").getFile()); |
What's needed here is a way to abstract the location where tna loads its configuration files. In an ideal world that would be a read/write location such as /etc/tnatool or c:/tnatool |
The spatial xml file fragment is related to spatialConfigPaths and ConfigPaths (which are columns in dbInfo.csv) From Databases.java: public static void updateDbInfo(boolean b) {
dbsize = infoMap.get("databaseIndex").length;
spatialConfigPaths = infoMap.get("spatialConfigPaths");
ConfigPaths = infoMap.get("ConfigPaths");
if(b){
String connectionPath = path + "../../src/main/resources/";
for (int k=0; k<ConfigPaths.length; k++){
ConfigPaths[k] = connectionPath+ConfigPaths[k];
}
}
dbnames = infoMap.get("dbnames");
connectionURLs = infoMap.get("connectionURL");
usernames = infoMap.get("username");
passwords = infoMap.get("password");
} |
$ ag ConfigPaths .
src/main/webapp/resources/admin/dbInf.csv
1:databaseIndex,dbnames,spatialConfigPaths,ConfigPaths,connectionURL,username,password,censusMappingSource,gtfsMappingSource1,gtfsMappingSource2
src/main/java/com/model/database/queries/util/Hutil.java
32: sessionFactory[k] = new Configuration().configure(Databases.spatialConfigPaths[k]).buildSessionFactory();
51: sessionFactory[k] = new Configuration().configure(Databases.spatialConfigPaths[k]).buildSessionFactory();
src/main/java/com/model/database/Databases.java
97: spatialConfigPaths = infoMap.get("spatialConfigPaths");
98: ConfigPaths = infoMap.get("ConfigPaths");
101: for (int k=0; k<ConfigPaths.length; k++){
102: ConfigPaths[k] = connectionPath+ConfigPaths[k];
128: public static String[] spatialConfigPaths = infoMap
129: .get("spatialConfigPaths");
130: public static String[] ConfigPaths = infoMap.get("ConfigPaths");
133: for (int k=0; k<ConfigPaths.length; k++){
134: ConfigPaths[k] = connectionPath + ConfigPaths[k];
src/main/java/com/model/database/onebusaway/gtfs/hibernate/ext/GtfsHibernateReaderExampleMain.java
70: factory[k] = createHibernateGtfsFactory(Databases.ConfigPaths[k],k);
81: factory[k] = createHibernateGtfsFactory(Databases.ConfigPaths[k],k);
src/main/resources/admin/resources/dbinfo.csv
1:databaseIndex,dbnames,spatialConfigPaths,ConfigPaths,connectionURL,username,password,censusMappingSource,gtfsMappingSource1,gtfsMappingSource2 |
From tomcat stderr logs.
|
Fixed by ca053f5 |
@BenFields724 @srinivas13794 Note this means that xml config files for specific databases now live under:
On tna.trilliumtransit.com. The versions which were in I'm going to remove those shortly. Actually I will copy them to Likewise |
Looks very similar to the problem we were seeing with dbInfo.csv.
The text was updated successfully, but these errors were encountered: