set apoc.import.file.enabled=true in your neo4j.conf - neo4j

I have a Neo4j Java project perfectly working inside my Eclipse IDE.
I use APOC to load an XML file and process it.
Since now I have to deploy my project, I need to export a Runnable Jar file.
The problem is that, despite the system sees my neo4j.conf file with this setting: apoc.import.file.enabled=true, at runtime I got this error:
Import from files not enabled, please set apoc.import.file.enabled=true in your neo4j.conf
It's pretty weird, because in the file I enabled the import from file with that string and the file is correctly detected.
Am I missing something?
EDIT: my neo4j.conf has only that line and works fine during the development mode in Eclipse.

Have you restarted the Neo4j after setting this line?
If not try after restart this may help.

Related

What is the location of the configuration file in Neo4J 3.2?

I just installed Neo4j 3.2.6 on Windows. I am trying to run apoc.load.json. I have moved the plugins folded. They really need to sort this out.
I run it and I'm getting this error:
Failed to invoke procedure apoc.load.json: Caused by:
java.lang.RuntimeException: Import from files not enabled, please set
apoc.import.file.enabled=true in your neo4j.conf
only one problem, there is no neo4j.conf.
Database starts fine. I can run other statement, just not APOC procedures.
Any ideas?
You can take a look in the Neo4j file location docs. According to these docs the neo4j.conf file location in Windows installations is:
<neo4j-home>\conf\neo4j.conf for zip installations
%APPDATA%\Neo4j Community Edition\neo4j.conf for desktop installation (installer)
For Neo4j Desktop:
C:\Users{user}\AppData\Roaming\Neo4j
Desktop\Application\neo4jDatabases\database-{YOUR DATABASE HERE}\installation-{version}\plugins
For Neo4j Desktop,
Click pull down menu of your project
Click "Open Folder" menu
Click "Configuration"
Then new window of explorer will be opened with the path with neo4j.conf file included, for example:
C:\Users\{user}\AppData\Local\Neo4j\Relate\Data\dbmss\dbms-3a5f5b9b-77b4-48cf-96f4-43aa81cce24b\conf\
If you are not able to find in other directions, you can try searching in the below path where I found my configuration located:
C:\Users\{user}\.Neo4jDesktop\neo4jDatabases\database-{YOUR DATABASE
HERE}\installation-{version}\conf
Hope it helps.
Even though the Neo4j documentation says that for windows desktop neo4j.conf file location is
%APPDATA%\Neo4j Community Edition\neo4j.conf, I couldn't find the file at that particular location.
I found the neo4j.conf file at below location :
{YOUR_NEO4J_DB_DIRECTORY}\neo4jDatabases\database-{SOME_VERSION_STRING}\installation-{YOUR_NEO4J_VERSION}\conf
Hope it helps someone!

Neo4j 3.1.0 apoc.export.graphml issue

I am trying to export my db as a graphml file via the apoc.export.graphml procedure in Neo4j 3.1 + 3.1.0.3:
call apoc.export.graphml.all("test",{})
I get this error message:
Failed to invoke procedure apoc.export.graphml.all: Caused by:
java.lang.RuntimeException: Import from files not enabled, please set
apoc.import.file.enabled=true in your neo4j.conf
I have edited my neo4j.conf file to add
apoc.import.file.enabled=true
at the end of the document but I'm still getting the same error message.
What am I doing wrong?
Thanks for your help.
I had the same problem and did not find any from anywhere. I just managed to resolved this issue. Hopefully, this solves yours as well.
Environment: MacOs, Neo4j 3.1.2 CE
1) Change your .neo4j.conf (mine is under my ~/Documents/Neo4j/). You can easily edit by pressing [Options...] button. I commented the import directory comment out as well, just in case.
#dbms.directories.import=import
apoc.import.file.enabled=true
2) I originally have the apoc-3.1.2.5.jar under ~/Documents/Neo4j/default.graphdb/plugins/ directory which worked except reading xml from the local disk. So, I put the jar under my app directory, /Applications/Neo4j.app/Contents/Resources/app/plugins
The "Neo4j.app" is my symbolic link. You probably will see the app directory as "Neo4j Community Edition 3.1.2.app"
3) Do Not restart by pressing [Stop] and [Start], make sure you quit the Neo4j and relaunch. Stop and Start seems to reload config but it does not seem to load jar from plugins.
4) How to check:
call apoc.config.list
You should see:
apoc.import.file.enabled true
I originally added
apoc.import.file.enabled=true
to the end of the neo4j.conf file and "HTTP logging configuration" section.
I moved the comment to the "Server configuration" section and now it works.

Wampserver sql dump

I know this has been asked many times before. But I am getting a:
The mbstring extension is missing. Please check your PHP configuration.
First off I am using WanmpServer3.0.0 64 on a Win7 64 VM.
-I tried editing the php.ini file to give an absolute path to no avail
-made sure that the extension=phpmbstring.dll is uncommented
Another problem is that i noticed that whenever i load a php page it has fatal errors for my mysql commands.
When I use the wampmanager from the tray to open the php.ini file instead of through windows explorer I get:
Cannot find the C:\wamp64\bin\apache\apache2.4.17\bin\php.ini file. Do you want to create a new file?
So now I'm thinking something has gone drastically wrong and would like to uninstall/reinstall Wamp. I attempt to use the mysql console to save my databases before deleting the wamp directory. However when I run a mysqldump -all-databases > all_database.sql it just drops down to an empty line and nothing happens.
mysql console screenshot
If I browse around in the C:\wamp64 directory i find the "data" directory within \bin\mysql where it seems all of my databases reside but not in readable form.
Is there anyway to save my databases??
BTW: This whole setup was working fine previously, so I'm not sure what caused the crash and burn.
Was able to figure it out.
I opened the php.ini file from the PHP bin folder and copied all of the contents into a new php.ini file to reside in the apache bin file.
Now everything works again.
I'm not sure this is how wampserver is supposed to work or what changed to start the problem but it's pseudo-resolved now.

Log4j2 not loading log4j2.xml

I have a problem concerning log4j2 which does not load the log4j2.xml configuration file in a project.
The project is bundled into an uber jar file. When running the application using java -jar jarfile.jar the application starts but log4j prints the following error to the console:
ERROR StatusLogger No log4j2 configuration file found. Using default
configuration: logging only errors to the console.
I checked the jar and it definitely contains a log4j2.xml file in the root location.
Because I could not figure out why this does not work I debugged to log4j2 bootstrap code. I found out that log4j never tries to read the log4j2.xml. This should happen in org.apache.logging.log4j.core.config.ConfigurationFactory.Factory#getConfiguration.
Unfortunately the list of factories used in this method is empty thus the method always returns null.
Any ideas on this?
If you want to check this clone https://github.com/cryptomator/cryptomator, cd to the main directory in the cloned repo and run mvn clean install -DskipTests -P uber-jar afterwards you will find the jar file in question under main/uber-jar/target.
I suspect this is the same issue as Log4j2 configuration not found when running standalone application builded by shade plugin since it sounds like you are building an uber jar.
I have a similar issue, but not using shade.
I have a jar file, with dependencies in /lib
I have a log4j2.xml file in the same location as the main jar file.
I can (obviously) run the jar file by calling:
java -Dlog4j2.configurationFile=.\log4j2.xml -jar myjar.jar
However, in Windows, it's possible simply to double-click the jar file to load it. Everything loads and works, except that it doesn't find the log4j2.xml file - so no logfile is written.
What I would like to be able to do is have a simple jar file I can hand to someone and have it run on their machine, with the ability to configure logging in the event they run into issues.
EDIT:
To do that, you need to amend your code thus:
public class MyClass
{
static
{
System.setProperty("log4j.configurationFile", "log4j2.xml");
}
private final static Logger LOG = LogManager.getLogger();
//OTHER STUFF HERE
}
Thanks to Load Log4j2 configuration file programmatically for the answer.

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.
Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.
After Erlang install using default install location to C:\Program Files\erl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:
Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.
Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?
1- Set environment variable:
Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4
note: don't include bin on above step.
2- Add %ERLANG_HOME%\bin to the PATH environmental variable:
Variable name : PATH
Variable value: %ERLANG_HOME%\bin
This works well.
There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.
editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:
if not exist "!ERLANG_HOME!\bin\erl.exe" (
that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:
"!ERLANG_HOME!\bin\erl.exe"
I simply hardcoded the path to my erl.exe:
"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"
With the pathing correct, the rabbitmq .bat files will run.
I had the similar issue, modifying ERLANG_HOME in .bat files did not work. Then I tried echo %ERLANG_HOME% in command prompt, that did not print the environment variable value(I could see that ERLANG_HOME environment variable has been created under advance system settings), that lead me to believe that I need to restart server for 64 bit installation of Erlang. After rebooting server, It worked like a charm. I hope this helps someone.
Just to share an up-to-date answer as of 2019: On Windows Server 2019, after setting up the environment variable, a restart is required to solve the problem.
I got into same kind of problem.
I solved it by doing three changes as given below.
Update Path variable "ERLANG_HOME" : "C:\Program Files\erl8.0" in Environment Variables.
Upadte "Path" variable "Path" : ";%ERLANG_HOME%\bin;"
Give urself FULL CONTROL permissions over "Program Files" in C drive.
It worked for me in this way.
This problem still occurs in Erlang 18.3 (erl7.3) and RabbitMQ 3.6.9 on Windows when upgrading from any older version of RabbitMQ to version 3.6.9. The solution as already stated here is to manually set ERLANG_HOME with 'setx -m ERLANG_HOME "C:\Program Files\erl7.3"' before starting the service.
What happens is that the RabbitMQ 3.6.9 installer removes the environment variable ERLANG_HOME from the system while removing the older version of RabbitMQ. Then, when it proceeds to the installation step, it does not put back the ERLANG_HOME variable. Then, the batch files that start up RabbitMQ cannot find Erlang. They try to find Erlang's home directory using "where.exe" but it always fails after an upgrade.
RabbitMQ's installer also does not kill all of the Erlang background processes, causing many of its files to be undeletable due to the Windows "file in use" problem. This leaves behind "files in use" in %APPDATA%\RabbitMQ and "C:\Program Files\RabbitMQ." These processes are "erl.exe," "erlsrv.exe," and "epmd.exe." The RabbitMQ installer should taskkill these processes after shutting down the RabbitMQ Windows service.
RabbitMQ is rather clunky on Windows.
Download Erlang or OTP - Only one Version of OTP should be installed
Download RabbitMQ installer
Install both exe file as Administrator
Set class path for Erlang. (Setting classpath is a bit troublesome, so follow these steps)
Set a new path with name ERLANG_HOME and value C:\Program Files\erl-23.1 (do not copy bin folder here)
Edit System "path" and add %ERLANG_HOME%\bin
Go to Start - Open rabbitmq command promt and run
rabbitmq-plugins enable rabbitmq_management
Navigate to localhost:15672
Use guest/guest to login
Interesting that this worked for you. There is record of a two bugs in Erl5.9.2 that cause an incomplete installation where %ERLANG_HOME%\bin is not installed.
Either of
* Installed 64bit erlang on 32bit machine
* "The program can't start because MSVCR100.dll is missing from your computer."
https://groups.google.com/d/topic/erlang-programming/wGtFLzapiQ0/discussion
Try 5.9.1 or any other version. They also mention making the future versions of the installer alert you if it fails.
I just had the same problem mentioned here. I installed otp_win64_R15B02 on a Windows 7 machine and everything worked perfectly, but I used the same installer on a Windows 2008 server and the bin directory was not created. I then uninstalled otp_win64_R15B02 and downloaded the otp_win64_R15B02_with_MSVCR100_installer_fix and the bin directory was created.
I suspect the reason it worked on my Windows 7 system is that I have Visual Studio installed and the required libraries were already available which allowed the otp_win64_R15B02 installer to work correctly.
Oh, and if you're installing Erlang to run RabbitMQ the RabbitMQ install will succeed with the broken installer but installing otp_win64_R15B02_with_MSVCR100_installer_fix after RabbitMQ will not work, just un-install and re-install RabbitMQ to resolve this.
Just give C:\Program Files\erl10.6\ not C:\Program Files\erl10.6\bin\erl.exe in the environment variable. If you open the server.bat file I came to know the issueenter image description here
I think this is encoding issue on windows.I see a correct value but I write echo %ERLANG_HOME% on console the value come with question mark. These steps fix it.
1.go environment variable window
2.edit ERLANG_HOME item
3.copy the value, open notepad and paste there
4.copy again on notepad and paste to edit window
5.apply and exit window
6.close command line tools and reopen
7.run rabbitmq bat file.
I solved it in a quick and dirty way,without naming path variables
I've opened the bat file and replaced every occurrence of
!ERLANG_HOME!\bin\erl.exe
with hard coded path for example might be diffrent path for you because of diffrent version
C:\Program Files\erl10.3\erts-10.3\bin\erl.exe
and replaced
%RABBITMQ_HOME%\escript\rabbitmq-plugins
with
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.14\escript\rabbitmq-plugins
Even I was this problem. The issue was the environment variable ERLANG_HOME=c:\Program Files\erl9.0 which was never existed.
I cross checked the path. The correct path was c:\Program Files\erl9.3.
After correcting the
ERLANG_HOME=c:\Program Files\erl9.3
the problem solved. So, definitely it is a path issue.
In my case, it should be installed erlang using admin role running
If above solutions doesn't work for you then you can try following
Find another compatible version of erlang for your rabbit mq e.g. for rabbit 3.7.x erlang version 20.3.x to 22.0.x all are compatible .
Right click newly downloaded erlang version and from properties select the option to unblock the file .
Run the erlang with admin persssion .
Re run rabbit mq exe

Resources