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.

Error while importing xlm file to Neo4j

I am facing a problem while importing xml file using apoc procedure.

CALL apoc.load.xml('bom.xml') | [also tried with whole file path and file:///bom.xml]

YIELD value

RETURN value

The error is:
Failed to invoke procedure apoc.load.xml: Caused by: java.net.MalformedURLException: no protocol: bom.xml

I have also changed the apoc config in settings
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=false

Can anyone please help me on this?

10 REPLIES 10

Please specify this in your settings-
apoc.import.file.enabled=true
apoc.export.file.enabled=true

Thank you Pawas.

I have changed the settings, but still the problem is there

apoc is not installed kindly do that


Apoc is already installed.
I have also tried , by importing the file from the import directory of neo4j. But still some error is there.

Do I want to change the path? as it is showing Caused by: java.net.MalformedURLException: no protocol: BOM.xml

@mahinshah.k.nazar

is the name of the XML file, BOM.xml or bom.xml as your examples above include both references.
Per Load XML - APOC Documentation

Import files are read from the import directory, which is defined by the dbms.directories.import property.   

is the file in the import directory.

Also relative to the error no protocol: BOM.xml I suspect this is because you need to specify file:///BOM.xml, if in fact the name of the file is BOM.xml

The file name is BOM,(bom was my mistake).

I have tried CALL apoc.load.xml('file:///BOM.xml'), but its showing (The system cannot find the file specified)


But the file is already in the import
3X_6_d_6d45c9b2f8b606edec915a43239b6b56d0478d51.jpeg

call apoc.import.xml("file:///State_and_County_Report.XML")
YIELD node
RETURN node;
write the above code you're not writing the apoc code properly from writing this you will get it.

Thanks Pawas.

There was one error in config settings, that caused the error while loading xml.

Yea , and I got the graph using the 'apoc.import' .

@mahinshah.k.nazar

might you elaborate on the misconfiguration so that we can improve the produce to better recognize and make the error more clearer

apoc.import.file.enabled=true.

I set it as 'false' by mistake. That was the reason for the error