cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

java.lang.NullPointerException

thomasf
Node Clone

Latest Neo4j (4.2.6) and latest APOC (4.2.0.4) on an empty database:

call apoc.import.xml("file:‎⁨/Users/Thomas/Library/Application Support/⁨com.Neo4j.Relate⁩/Data⁩/⁨dbmss⁩/dbms-b0482810-7255-47a0-b994-9228e7bcaa28⁩/import⁩/FODS_Person.xml")

Inevitably leads to:

Failed to invoke procedure apoc.import.xml: Caused by: java.lang.NullPointerException

What have I missed?

1 ACCEPTED SOLUTION

thomasf
Node Clone

Hi again,

I managed to get by this by way of the simple invocation:

call apoc.load.xml("file:///FODS_Person.xml")

I do not know why. And I do think that the punishment that I received yesterday ([Neo.DatabaseError.General.UnknownError]) was too harsh.

Case closed.

View solution in original post

6 REPLIES 6

Hi Thomas,

I assume you have the following config enabled :
apoc.import.file.enabled=true

By default file paths are relative to the import directory. If you want to use absolute paths, you need to add the following config :
apoc.import.file.use_neo4j_config=false
As your file seems to be in the "import" directory already : call apoc.import.xml("file:///FODS_Person.xml") should also do.

But I'd still expect a "FileNotFound" rather than a "NullPointer", so there may be something else going on. Any stack trace from the log?

Regards,

David

thomasf
Node Clone

Hi David, and thanks for picking this up. Yes, no and it also works (your 3 suggestions).
I am looking at the debug log right now.
Here are some initial lines from the last session:

2021-05-10 14:03:06.094+0000 INFO [o.n.k.a.DatabaseAvailabilityGuard] [neo4j/cab23646] Requirement Database unavailable makes database neo4j unavailable.
2021-05-10 14:03:06.095+0000 INFO [o.n.k.a.DatabaseAvailabilityGuard] [neo4j/cab23646] DatabaseId{cab23646[neo4j]} is unavailable.
2021-05-10 14:03:06.127+0000 INFO [o.n.k.a.DatabaseAvailabilityGuard] [neo4j/cab23646] Fulfilling of requirement 'Database unavailable' makes database neo4j available.
2021-05-10 14:03:06.128+0000 INFO [o.n.k.a.DatabaseAvailabilityGuard] [neo4j/cab23646] DatabaseId{cab23646[neo4j]} is ready.
2021-05-10 14:03:06.128+0000 INFO [c.n.k.i.p.PageCacheWarmer] [neo4j/cab23646] Page cache warmup started.
2021-05-10 14:03:06.219+0000 INFO [c.n.k.i.p.PageCacheWarmer] [neo4j/cab23646] Page cache warmup completed. 100 pages loaded. Duration: 90ms. 1.11 pages/ms
2021-05-10 14:03:09.576+0000 INFO [o.n.k.a.p.GlobalProcedures] Called db.clearQueryCaches(): Query cache already empty.
2021-05-10 14:03:09.601+0000 INFO [o.n.m.DatabaseHealth] [neo4j/cab23646] Database health set to OK
2021-05-10 14:03:09.602+0000 INFO [c.n.d.DbmsReconciler] Database 'neo4j' transition is complete from INITIAL{db=neo4j/cab23646} to STARTED{db=neo4j/cab23646}
2021-05-10 14:03:09.603+0000 INFO [c.n.d.StartupOperator] All databases were handled at startup
2021-05-10 14:03:09.603+0000 INFO [o.n.b.t.DefaultReconciledTransactionTracker] Enabling with transaction ID 51
2021-05-10 14:03:09.921+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.export.xls.ExportXls from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: org/apache/poi/ss/usermodel/Row
2021-05-10 14:03:09.994+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.mongodb.MongoDBColl from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: org/bson/conversions/Bson
2021-05-10 14:03:10.054+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.couchbase.CouchbaseConnection from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: com/couchbase/client/core/env/Authenticator
2021-05-10 14:03:10.058+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.couchbase.document.CouchbaseUtils from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: com/couchbase/client/core/msg/kv/MutationToken
2021-05-10 14:03:10.060+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.couchbase.CouchbaseManager from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: com/couchbase/client/java/env/ClusterEnvironment
2021-05-10 14:03:10.224+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load apoc.load.LoadXls from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: org/apache/poi/ss/usermodel/Cell

And it goes on like that for a long time. Towards the end, I get:

2021-05-10 14:03:23.315+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load org.apache.commons.logging.impl.Log4JLogger from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: org/apache/log4j/Priority
2021-05-10 14:03:23.321+0000 WARN [o.n.k.a.p.GlobalProcedures] Failed to load org.apache.commons.logging.impl.LogKitLogger from plugin jar /Users/Thomas/Library/Application%20Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/plugins/apoc-4.2.0.4.jar: org/apache/log/Logger
2021-05-10 14:03:25.114+0000 INFO [c.n.m.g.GlobalMetricsExtension] Sending metrics to CSV file at /Users/Thomas/Library/Application Support/com.Neo4j.Relate/Data/dbmss/dbms-b0482810-7255-47a0-b994-9228e7bcaa28/metrics
2021-05-10 14:03:25.195+0000 INFO [o.n.b.BoltServer] Bolt enabled on localhost:7687.
2021-05-10 14:03:25.195+0000 INFO [o.n.s.AbstractNeoWebServer$ServerComponentsLifecycleAdapter] Starting web server
2021-05-10 14:03:27.789+0000 INFO [c.n.s.e.EnterpriseNeoWebServer] Remote interface available at http://localhost:7474/
2021-05-10 14:03:27.790+0000 INFO [o.n.s.AbstractNeoWebServer$ServerComponentsLifecycleAdapter] Web server started.
2021-05-10 14:07:41.607+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=125, gcTime=174, gcCount=1}
2021-05-10 14:09:29.220+0000 ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Lexical error at line 1, column 175. Encountered: after : "", reference d1179b59-cf1b-4f3f-a898-c6fb4f10ed76.
2021-05-10 14:09:29.221+0000 ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Lexical error at line 1, column 175. Encountered: after : "", reference d1179b59-cf1b-4f3f-a898-c6fb4f10ed76.
org.neo4j.cypher.internal.parser.javacc.TokenMgrException: Lexical error at line 1, column 175. Encountered: after : ""
at org.neo4j.cypher.internal.parser.javacc.CypherTokenManager.getNextToken(CypherTokenManager.java:6201) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.jj_scan_token(Cypher.java:8099) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.jj_3_20(Cypher.java:6390) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.jj_2_20(Cypher.java:5225) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Expression9(Cypher.java:2150) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Expression10(Cypher.java:2130) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Expression11(Cypher.java:2108) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Expression12(Cypher.java:2086) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Expression(Cypher.java:2078) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.CallClause(Cypher.java:1287) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Clause(Cypher.java:362) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.SingleQuery(Cypher.java:281) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.QueryPart(Cypher.java:241) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.RegularQuery(Cypher.java:235) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Query(Cypher.java:166) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Statement(Cypher.java:139) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.parser.javacc.Cypher.Statements(Cypher.java:109) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.compiler.phases.JavaccParsing$.process(JavaccParsing.scala:68) ~[neo4j-cypher-planner-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.compiler.phases.JavaccParsing$.process(JavaccParsing.scala:36) ~[neo4j-cypher-planner-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.Phase.$anonfun$transform$1(Phase.scala:36) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.helpers.package$.$anonfun$closing$1(package.scala:24) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.helpers.package$.using(package.scala:32) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.helpers.package$.closing(package.scala:24) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.Phase.transform(Phase.scala:35) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.Phase.transform$(Phase.scala:34) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.compiler.phases.JavaccParsing$.transform(JavaccParsing.scala:36) ~[neo4j-cypher-planner-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.cypher.internal.frontend.phases.PipeLine.transform(Transformer.scala:59) ~[neo4j-front-end-4.2.6.jar:4.2.6]
at org.neo4j.fabric.pipeline.FabricFrontEnd$Pipeline$parseAndPrepare$.process(FabricFrontEnd.scala:153) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.$anonfun$computePlan$1(FabricPlanner.scala:87) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.trace(FabricPlanner.scala:125) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.computePlan(FabricPlanner.scala:86) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.$anonfun$plan$1(FabricPlanner.scala:79) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.cache.FabricQueryCache.computeIfAbsent(FabricQueryCache.scala:52) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.plan$lzycompute(FabricPlanner.scala:80) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.planning.FabricPlanner$PlannerInstance.plan(FabricPlanner.scala:76) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.executor.FabricExecutor.run(FabricExecutor.java:120) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.fabric.bolt.BoltFabricDatabaseService$BoltTransactionImpl.executeQuery(BoltFabricDatabaseService.java:165) ~[neo4j-fabric-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.AbstractTransactionStateMachineSPI$AbstractBoltResultHandle.start(AbstractTransactionStateMachineSPI.java:135) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State.startExecution(TransactionStateMachine.java:534) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State$2.run(TransactionStateMachine.java:330) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.run(TransactionStateMachine.java:84) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.run(TransactionStateMachine.java:77) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.v4.runtime.InTransactionState.processRunMessage(InTransactionState.java:81) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.v4.runtime.InTransactionState.processUnsafe(InTransactionState.java:48) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.nextState(AbstractBoltStateMachine.java:143) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.process(AbstractBoltStateMachine.java:91) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:90) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.DefaultBoltConnection.lambda$enqueue$0(DefaultBoltConnection.java:147) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatchInternal(DefaultBoltConnection.java:236) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:171) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:161) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:246) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$3(ExecutorBoltScheduler.java:229) ~[neo4j-bolt-4.2.6.jar:4.2.6]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.63.Final.jar:4.1.63.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
2021-05-10 14:13:52.062+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=112, gcTime=0, gcCount=0}
2021-05-10 14:24:22.268+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=201, gcTime=295, gcCount=1}
2021-05-10 14:26:55.347+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=109, gcTime=120, gcCount=1}

The plugins folder contains:

3X_5_c_5c5c947be4c8a4c6d88012b86e85a26b27ee6b88.png

What is wrong here? Why does it try to load all those modules? Cleaning up is maybe what blocks the system?

Best, Thomas

thomasf
Node Clone

Or maybe this, which I missed up above, is the problem:

2021-05-10 14:07:41.607+0000 WARN [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=125, gcTime=174, gcCount=1}
2021-05-10 14:09:29.220+0000 ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Lexical error at line 1, column 175. Encountered: after : "", reference d1179b59-cf1b-4f3f-a898-c6fb4f10ed76.
2021-05-10 14:09:29.221+0000 ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Lexical error at line 1, column 175. Encountered: after : "", reference d1179b59-cf1b-4f3f-a898-c6fb4f10ed76.
org.neo4j.cypher.internal.parser.javacc.TokenMgrException: Lexical error at line 1, column 175. Encountered: after : ""
at org.neo4j.cypher.internal.parser.javacc.CypherTokenManager.getNextToken(CypherTokenManager.java:6201) ~[neo4j-cypher-javacc-parser-4.2.6.jar:4.2.6]

What is a "Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]"?

thomasf
Node Clone

I do not believe that there is a column 175 in my input in the desktop browser (stops at 152)

thomasf
Node Clone

Hi again,

I managed to get by this by way of the simple invocation:

call apoc.load.xml("file:///FODS_Person.xml")

I do not know why. And I do think that the punishment that I received yesterday ([Neo.DatabaseError.General.UnknownError]) was too harsh.

Case closed.

Good to know you're all sorted.

To tie the loose ends, a few comments about the warnings/errors in the log :

WARN [o.n.k.a.p.GlobalProcedures] Failed to load ...

Those are expected APOC warnings : some procedures rely on external jars that are not present in your plugin directory (for example jdbc driver jars would be needed to use the load jdbc procedures).

ERROR [o.n.b.r.s.i.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: Lexical error at line 1, column 175. Encountered: after : ""

That's generally just a cypher syntax issue. Maybe a query with unclosed quotes or something of the sort.

Regards,

David

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online