Hi,
I have a problem with gurux.dlms.server.example.java. I use Ubuntu 20.04.4 LTS. I tried to connect server and client. I cloned gurux.dlms.java from github. Then I used maven and compiled gurux.dlms.server.example.java. But when I tried to run server, I got everytime error.
Commands, which I used:
ubuntu@ubuntu:~/gurux.dlms.java/gurux.dlms.server.example.java$ java -jar target/gurux.dlms.server.example.java-0.0.1-SNAPSHOT.jar
home/ubuntu/gurux.dlms.java/gurux.dlms.server.example.java/target/data.csv (No such file or directory)
Exception in thread "main" java.lang.RuntimeException: home/ubuntu/gurux.dlms.java/gurux.dlms.server.example.java/target/data.csv (No such file or directory)
at gurux.dlms.server.example.GXDLMSBase.addProfileGeneric(GXDLMSBase.java:530)
at gurux.dlms.server.example.GXDLMSBase.init(GXDLMSBase.java:840)
at gurux.dlms.server.example.GXDLMSBase.<init>(GXDLMSBase.java:361)
at gurux.dlms.server.example.GXDLMSServerSN.<init>(GXDLMSServerSN.java:51)
at gurux.dlms.server.example.GuruxDlmsServerExample.main(GuruxDlmsServerExample.java:128)
I did try to run this with Ubuntu and it also failed. Modify those functions and it'll start to work.
static final String getDataFile() {
return "data.csv";
}
// Settings file is saved to same directory where app is.
static final String getSettingsFile(final String preFix) {
return preFix + "settings.xml";
}
For some reason, FileWriter will fail if the full path is given in Ubuntu and if a full path is not given it will come to the wrong location when running from Eclipse in Windows.
Hi,
Hi,
I did try to run this with Ubuntu and it also failed. Modify those functions and it'll start to work.
static final String getDataFile() {
return "data.csv";
}
// Settings file is saved to same directory where app is.
static final String getSettingsFile(final String preFix) {
return preFix + "settings.xml";
}
For some reason, FileWriter will fail if the full path is given in Ubuntu and if a full path is not given it will come to the wrong location when running from Eclipse in Windows.
I'll think about how this can be modified.
BR,
Mikko
Yeah, I modified these
Yeah, I modified these functions and now it's working good.
Thank you very much for your help.