我正在尝试使用 Windows 上的 AllegroGraph 客户端(版本 4.1.1)将 *.nt 文件导入 AllegroGraph。我使用 AllegroGraph WebView 应用程序来启动服务器。首先,我尝试创建一个连接、一个目录和一个存储库。创建存储库后,我的系统会抛出一个com.franz.agraph.http.exception.AGHttpException
这是我的源代码:
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-Class
我已经用谷歌搜索了一个解决方案,并查看了 createRepository 的 javadoc( ) 命令,但找不到任何解决方案。什么可能导致这种行为,我该如何解决?
我的操作系统是 Windows 7 SP 1,java 类使用 JDK 1.6 运行