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.

Apoc.load.xls throwing errors (log4j related)

mbandor
Graph Voyager

I've created a new project and clean database. I've installed the APOC libraries and created the apoc.conf file. When trying to load an Excel file, I get the following error:

Failed to invoke procedure apoc.load.xls: Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager

This is the Cypher script:

call apoc.load.xls('DR Data.xlsx', 'DRs-All-PhaseB', {header:true})
yield map as row
return count(row)

I've previously used the apoc call before (different project and database) and never encountered this error. Any ideas?

1 ACCEPTED SOLUTION

I did some additional experimenting on a different laptop. Using Neo4j 4.4.5, with APOC 4.4.0.3 (including the XLS dependencies v4.4.0.3) and everything seems to work as it did before. I tried an XLSX version and it loaded and returned the rows just fine. I'll have to repeat the experiment on my work laptop tomorrow.

View solution in original post

9 REPLIES 9

@mbandor
Can you please provide details and specifically

  • what version of Neo4j
  • what version of APOC (i.e. return apoc.version(); )

Neo4j Desktop, v1.4.14, Neo4j database 4.4.4 and APOC 4.4.0.3.

I also just tried it under another database version (4.3.7 and APOC 4.3.0.4) and get the same error using a different Excel spreadsheet (which has imported just fine in the past).

Some additional information. I just tried again on a different laptop (Desktop 1.4.14, Neo4j 4.4.0, APOC 4.4.0.1) and got the same error. The jar files and versions (in the plugins directory are):

apoc-4.4.0.1.jar
commons-collections4-4.4.jar
curvesapi-1.06.jar
neo4j-jwt-addon-1.2.0.jar
poi-5.1.0.jar
poi-ooxml-5.1.0.jar
xmlbeans-5.0.2.jar

mbandor
Graph Voyager

Out of curiosity I tried converting the Excel file to a CSV and trying the apoc.load.csv option. It worked as it should. I have a workaround but the Excel option is still problematic in the long run.

@mbandor
I'm not able to reproduce and yet I'm running with 4.4.5 and my plugins has

ls -al ../plugins/
total 37264
drwxr-xrwx  2 neo4j neo4j     4096 Apr  1 21:13  .
drwxr-xrwx 16 neo4j neo4j     4096 Mar 23 19:34  ..
-rw-rw-r-x  1 neo4j neo4j 24184751 Apr  1 21:13  apoc-4.4.0.3-all.jar
-rw-rw-r--  1 neo4j neo4j 13956780 Apr  1 21:11 apoc-xls-dependencies-4.4.0.3.jar
-rw-r--rwx  1 neo4j neo4j     2217 Feb  2 05:14  README.txt

and I have a .xls in import/, as evidence

 ls -al import/
total 24
drwxr-xrwx  2 neo4j neo4j  4096 Apr  1 21:23 .
drwxr-xrwx 16 neo4j neo4j  4096 Mar 23 19:34 ..
-rw-rw-r--  1 neo4j neo4j 14848 Apr  1 21:18 c90A.xls

note I have a XLS and you report a DR Data.xlsx, i.e. a XLSX. Further my XLS is not created firstly/natively using Microsoft Office but rather I used OpenOffice to save a Spreadsheet in Microsoft 2000 / XP xls format. Now whether this has anything to do with anything? but I can then run

@neo4j> call apoc.load.xls('c90A.xls','Users', {header:true}) yield map as row return row.Name,row.Active;
+----------------------------------+
| row.Name         | row.Active |
+----------------------------------+
| "Dana Canzano"  | "true"       |
| "Mike Bandor    | "true"       |
+----------------------------------+

2 rows
ready to start consuming query after 4 ms, results consumed after another 30 ms
@neo4j>

I've tried it on a different machine with XLS and XLSX and get the same error. The CSV version seems to work okay.

I did some additional experimenting on a different laptop. Using Neo4j 4.4.5, with APOC 4.4.0.3 (including the XLS dependencies v4.4.0.3) and everything seems to work as it did before. I tried an XLSX version and it loaded and returned the rows just fine. I'll have to repeat the experiment on my work laptop tomorrow.

I repeated the experiment on my work laptop and it worked just fine under Neo4j 4.4.4. Now the next issue I need to work around is running out of Java heap space with the spreadsheet.