I´m trying to import a *.nt File into AllegroGraph by using the AllegroGraph Client (version 4.1.1) on Windows. I use the AllegroGraph WebView application to start the server. First of all, I tried to create a connection, a catalog and a repository.
Upon creating a repository, my system throws an com.franz.agraph.http.exception.AGHttpException
This is my source-code:
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);
}
Output:
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
Line 86 is
AGRepository myRepository = catalog.createRepository(REPOSITORY_ID);
How I run it:
1) Run agwebview.exe --port 8080
2) Wait for the server to be started
3) Run Java-Class
I´ve already searched fo a solution with google, and looked into the javadoc of the createRepository() command, but couldnt find any solution. What could cause this behaviour and how can I fix it ?
My OS is Windows 7 SP 1 and the java-class runs with JDK 1.6
Fixed it by switching over to Linux and using the most recent AGWebView version. Afterwards I figured out, that Ive initially used the client of AG 4 for an AG 3.3 Server.
For anyone else who encounters this problem: Make sure you use the right JAR-files