Index: core-library/src/main/java/org/apache/james/util/JDBCBayesianAnalyzer.java
===================================================================
--- core-library/src/main/java/org/apache/james/util/JDBCBayesianAnalyzer.java	(revision 582553)
+++ core-library/src/main/java/org/apache/james/util/JDBCBayesianAnalyzer.java	(working copy)
@@ -26,6 +26,8 @@
 import java.util.Map;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
 
 import java.sql.Connection;
 import java.sql.PreparedStatement;
@@ -354,21 +356,32 @@
         }
     }
     
+    public void initSqlQueries(Connection conn, String sqlFile) throws Exception {
+    	InputStream inp = new FileInputStream(sqlFile);
+    	try {
+    		initSqlQueries(conn, inp);
+    	} finally {
+    		if (inp!=null) {
+    			inp.close();
+    		}
+    	}
+    }
+    
     /**
      * Initializes the sql query environment from the SqlResources file.
      * Will look for conf/sqlResources.xml.
      * @param conn The connection for accessing the database
-     * @param file The sqlResources.xml file
+     * @param sqlInputStream The sqlResources.xml file
      * @throws Exception If any error occurs
      */
-    public void initSqlQueries(Connection conn, String file) throws Exception {
+    public void initSqlQueries(Connection conn, InputStream sqlInputStream) throws Exception {
         try {
             if (conn.getAutoCommit()) {
                 conn.setAutoCommit(false);
             }
             
-            this.sqlFile = new File(file).getCanonicalFile();
-            sqlQueries.init(this.sqlFile, JDBCBayesianAnalyzer.class.getName() , conn, getSqlParameters());
+            //this.sqlFile = new File(sqlInputStream).getCanonicalFile();
+            sqlQueries.init(sqlInputStream, JDBCBayesianAnalyzer.class.getName() , conn, getSqlParameters());
             
             checkTables(conn);
         } finally {
Index: core-library/src/main/java/org/apache/james/management/BayesianAnalyzerManagement.java
===================================================================
--- core-library/src/main/java/org/apache/james/management/BayesianAnalyzerManagement.java	(revision 582553)
+++ core-library/src/main/java/org/apache/james/management/BayesianAnalyzerManagement.java	(working copy)
@@ -90,8 +90,8 @@
     public void initialize() throws Exception {
         if (repos != null) {
             setDataSourceComponent((DataSourceComponent) selector.select(repos));
-            File sqlFile = fileSystem.getFile(sqlFileUrl);
-            analyzer.initSqlQueries(component.getConnection(), sqlFile.getAbsolutePath());
+            InputStream sqlInputStream = fileSystem.getResource(sqlFileUrl);
+            analyzer.initSqlQueries(component.getConnection(), sqlInputStream);
         }
     }
 
@@ -103,6 +103,10 @@
         if (reposPath != null) {
             setRepositoryPath(reposPath.getValue());
         }
+        Configuration sqlPath = arg0.getChild("sqlFile", false);
+        if (sqlPath != null) {
+        	this.sqlFileUrl = sqlPath.getValue();
+        }
     }
     
     /**
