关于driver.CreateGraph的ArangoDB JsonSyntaxException

时间:2015-08-11 16:01:55

标签: java arangodb jsonexception

我试图用它的Java驱动程序测试ArangoDB。我在CentOS 6.6上测试它。我收到了以下错误:

15:48:01.151 [main] DEBUG com.arangodb.http.HttpManager - [REQ]http-POST: url=http://127.0.0.1:8529/_api/gharial?waitForSync=true, headers=null, body={"name":"test","edgeDefinitions":[{"collection":"FriendsWith","from":["Profile"],"to":["Profile"]}],"orphanCollections":[]}
15:48:01.267 [main] DEBUG com.arangodb.http.HttpManager - [RES]http-POST: statusCode=503
15:48:01.269 [main] DEBUG com.arangodb.http.HttpManager - [RES]http-POST: text=<html><head><title>Service Unavailable</title></head><body><p>This service is temporarily not available. Please check the log file for errors.</p></body></html>
Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
    at com.google.gson.JsonParser.parse(JsonParser.java:65)
    at com.google.gson.JsonParser.parse(JsonParser.java:45)
    at com.arangodb.BaseArangoDriver.createEntity(BaseArangoDriver.java:209)
    at com.arangodb.BaseArangoDriver.createEntity(BaseArangoDriver.java:309)
    at com.arangodb.impl.InternalGraphDriverImpl.createGraph(InternalGraphDriverImpl.java:80)
    at com.arangodb.ArangoDriver.createGraph(ArangoDriver.java:4242)
    at Program.main(Program.java:76)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 29 path $
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1573)
    at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1423)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:546)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:429)
    at com.google.gson.JsonParser.parse(JsonParser.java:60)
    ... 11 more

Process finished with exit code 1

我尝试重启服务以及重新安装。 日志文件包含以下行:

2015-08-12T08:06:27Z [22123] ERROR TypeError: Cannot read property 'save' of undefined                                   
2015-08-12T08:06:27Z [22123] ERROR   at createQueue (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js:109:15)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js:394:1               
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)               
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)          
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:755:21)             
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                  
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js:33:18                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)    
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                   
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)              
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)                 
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                  
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24                       
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2                      
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)    
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)           
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9                             
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)                                                                               
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)                 
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)            
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)                  
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)                       
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)           
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)            
2015-08-12T08:06:27Z [22123] ERROR                                                                                                           
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module                                                                
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/server/modules/org/arangodb/foxx/queues.js]                                  
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)              
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                             
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)                        
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:755:21)                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)          
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                            
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js:33:18                                     
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)              
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)                             
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)                        
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)                           
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)          
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)                            
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24                                 
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2                                
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)              
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/server/modules/org/arangodb/foxx.js]
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)
2015-08-12T08:06:27Z [22123] ERROR   at createModule (/usr/share/arangodb/js/common/bootstrap/modules.js:517:19)
2015-08-12T08:06:27Z [22123] ERROR   at requireModuleFrom (/usr/share/arangodb/js/common/bootstrap/modules.js:619:21)
2015-08-12T08:06:27Z [22123] ERROR   at requirePackage (/usr/share/arangodb/js/common/bootstrap/modules.js:772:21)
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1209:21)
2015-08-12T08:06:27Z [22123] ERROR   at args.require (/usr/share/arangodb/js/common/bootstrap/modules.js:1367:21)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:32:24
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js:1395:2
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1415:10)
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR
2015-08-12T08:06:27Z [22123] ERROR Cannot compute Foxx application routes: [ArangoError 3103: failed to invoke module\nFile: /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js]
2015-08-12T08:06:27Z [22123] ERROR [ArangoError 3103: failed to invoke module
2015-08-12T08:06:27Z [22123] ERROR File: /usr/share/arangodb/js/apps/system/_api/gharial/APP/gharial.js]
2015-08-12T08:06:27Z [22123] ERROR   at [object Object].Module.run (/usr/share/arangodb/js/common/bootstrap/modules.js:1420:20)
2015-08-12T08:06:27Z [22123] ERROR   at ArangoApp.loadAppScript (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/arangoApp.js:452:24)
2015-08-12T08:06:27Z [22123] ERROR   at mountController (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:662:7)
2015-08-12T08:06:27Z [22123] ERROR   at /usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:631:9
2015-08-12T08:06:27Z [22123] ERROR   at Array.forEach (native)
2015-08-12T08:06:27Z [22123] ERROR   at routeApp (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/routing.js:630:32)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:268:10)
2015-08-12T08:06:27Z [22123] ERROR   at foxxRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1054:74)
2015-08-12T08:06:27Z [22123] ERROR   at execute (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1308:7)
2015-08-12T08:06:27Z [22123] ERROR   at Object.routeRequest (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1329:3)
2015-08-12T08:06:27Z [22123] ERROR   at Function.actions.defineHttp.callback (/usr/share/arangodb/js/actions/api-system.js:58:15)
2015-08-12T08:06:27Z [22123] ERROR

1 个答案:

答案 0 :(得分:1)

用户已删除系统_graphs集合,该集合用于ArangoDB内部的图形管理。

有争议的错误消息有点令人困惑,并且使用较新的ArangoDB版本进行了改进。

解决方案是to recreate the the collection by specifying it will be a system collection

db._create("_graphs", {isSystem: true})