我试图使用Windows4.1.1版本的*.nt客户端将一个AllegroGraph文件导入到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 --端口8080
2)等待服务器启动
3)运行Java类
我已经用谷歌搜索了一个解决方案,并查看了createRepository()命令的javadoc,但是找不到任何解决方案。是什么导致了这种行为,我该如何解决呢?
我的操作系统是Windows 7 SP 1,java类运行于JDK 1.6
发布于 2013-11-01 15:27:48
通过切换到Linux并使用最新的AGWebView版本来修正它。后来我发现,我最初在AG 3.3服务器上使用了AG 4的客户端。
对于其他遇到此问题的人,:确保您使用正确的JAR-文件。
https://stackoverflow.com/questions/18981908
复制相似问题