Could not open *.xml file
Closed this issue · 3 comments
-
Plugin version (or commit hash): 0.12.1724
-
IDE name and version:Intellij IDEA 2016.2.4
-
Java version:1.8
-
OS name and version: windows 10
-
What are you trying to do?
I joined a project which is using "github.com/alecthomas/log4go" that need a log.xml file. Other developer is using liteide,and everything is ok, but in my situation, i'm using intellij with go plugin, and cannot find log.xml file when running "go run", it said "LoadConfiguration: Error: Could not open "sysconf/log.xml" for reading: open sysconf/log.xml: The system cannot find the path specified." -
What would you expect to happen?
the xml file it can be found successfully -
What happens?
when i run "go run", it said "LoadConfiguration: Error: Could not open "sysconf/log.xml" for reading: open sysconf/log.xml: The system cannot find the path specified."
this is the code in my project to load xml file
log4go.LoadConfiguration("sysconf/log.xml")
the path of xml:
projectName/src/sysconf/log.xml
In this situation, the xml file cannot be found, but when i try to add "src/" before the path, it can be found successfully:
log4go.LoadConfiguration("src/sysconf/log.xml")
this is not the real way to solve this problem,because other developer is working with liteide which don't have this problem,I do not know how it is caused, On the face of it, It doesn't go into "src" to find xml file. Can you help me to solve this problem? Thank you a lot
Hi,
Please use a Go Application runner and specify the working directory for it. This is not a problem of the plugin but of how the go run
works. Let me know if you have any issues and I'll try and guide you to solve this.
@dlsniper Thank you for your prompt reply, It works when I add "src" in the working directory, Thanks again!!!
You're welcome, happy to help and glad it worked out!