我試圖通過在Windows上使用AllegroGraph客戶端(版本4.1.1)將* .nt文件導入AllegroGraph。我使用AllegroGraph WebView應用程序來啓動服務器。首先,我嘗試創建一個連接,一個目錄和一個存儲庫。 在創建一個存儲庫,我的系統拋出com.franz.agraph.http.exception.AGHttpException
AllegroGraph客戶端HTTPException
這是我的源代碼:
package mytest;
public class NTLoader {
public static String SERVER_URL = "http://localhost:8080";
public static String CATALOG_ID = "";
public static String REPOSITORY_ID = "test3";
public static String USERNAME = "me";
public static String PASSWORD = "xyzzy";
public static String TEMPORARY_DIRECTORY = "";
public static void main(String[] args) {
try {
// Tests getting the repository up.
System.out.println("\nStarting example.");
AGServer server = new AGServer(SERVER_URL, USERNAME, PASSWORD);
System.out.println(server.getRootCatalog().getCatalogName());
AGCatalog catalog = server.getCatalog(server.getRootCatalog().getCatalogName());
AGRepository myRepository = catalog.createRepository(REPOSITORY_ID);
} catch (Exception e) {
e.printStackTrace(System.out);
}
輸出:
Starting example().
/
org.openrdf.repository.RepositoryException: com.franz.agraph.http.exception.AGHttpException: An unexpected error occurred.
at com.franz.agraph.repository.AGCatalog.createRepository(AGCatalog.java:240)
at com.franz.agraph.repository.AGCatalog.createRepository(AGCatalog.java:211)
at mytest.NTLoader.main(NTLoader.java:86)
Caused by: com.franz.agraph.http.exception.AGHttpException: An unexpected error occurred.
at com.franz.agraph.http.handler.AGErrorHandler.newException(AGErrorHandler.java:70)
at com.franz.agraph.http.handler.AGErrorHandler.handleResponse(AGErrorHandler.java:47)
at com.franz.agraph.http.AGHTTPClient.get(AGHTTPClient.java:180)
at com.franz.agraph.http.AGHTTPClient.getTupleQueryResult(AGHTTPClient.java:376)
at com.franz.agraph.repository.AGCatalog.listRepositories(AGCatalog.java:173)
at com.franz.agraph.repository.AGCatalog.hasRepository(AGCatalog.java:193)
at com.franz.agraph.repository.AGCatalog.createRepository(AGCatalog.java:235)
... 2 more
86號線是
AGRepository myRepository = catalog.createRepository(REPOSITORY_ID);
如何我運行它:
1)運行agwebview.exe --port 8080
2)等待服務器要啓動
3)運行Java的類
從來就已經搜索fo與谷歌的溶液中,並調查了createRepository的的Javadoc()命令,但無法找到任何解決方案。什麼可能導致這種行爲,我該如何解決它?
我的操作系統是Windows 7 SP 1,並且java-class運行JDK 1.6