gurux.dlms.client.example (Serial)

1 viestiä / 0 new
Uusin kirjoitus
sierra002
gurux.dlms.client.example (Serial)

Hi im having this issue when i try to run this project, it happens when GXSerial() builder calls initialize() method at this line: System.loadLibrary("gurux.serial.java");

I have java 1.8

Exception in thread "main" java.lang.UnsatisfiedLinkError: no gurux.serial.java in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at gurux.serial.GXSerial.initialize(GXSerial.java:89)
at gurux.serial.GXSerial.(GXSerial.java:79)
at gurux.dlms.client.sampleclient.main(sampleclient.java:176)

is there any way to fix it? i have tried clean and build project, also i added gurux.serial.java to project libraries and looks like nothing works (even in to java libs path)

Kurumi
Käyttäjän Kurumi kuva

Hi,

gurux.serial.java uses external dll. You can download it here: http://www.gurux.org/Downloads/gurux.serial.java.zip

You can read more here:

http://www.gurux.fi/index.php?q=Gurux.Serial

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

sierra002

thanks Mikko

Kurumi
Käyttäjän Kurumi kuva

Hi,

Actually get the latest version from github. We have added binaries for Windows and Linux there. You do not need to compile binaties anymore.
Or if you are using Maven we have updated Maven package there.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

spark_

I am having the same problem described above. The error occurs when GXSerial() is initialized, in this line: System.load(file.getAbsolutePath());

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\<user>\AppData\Local\Temp\gurux.serial.java2806587330870363487.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at gurux.serial.GXSerial.initialize(GXSerial.java:283)
at gurux.serial.GXSerial.<init>(GXSerial.java:169)
at gurux.dlms.client.sampleclient.getManufactureSettings(sampleclient.java:136)
at gurux.dlms.client.sampleclient.main(sampleclient.java:66)

The file is created in the Temp folder.
I am using maven and have already tried newer versions of gurux.serial without any change. Can you help me fix it?

Kurumi
Käyttäjän Kurumi kuva

Hi,

Are you using Linux or Windows? 32 or 64 bits?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

tirpromaut

the same problem
win 64
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\dobrov\AppData\Local\Temp\gurux.serial.java415229422769134026.dll: Can't find dependent libraries

Kurumi
Käyttäjän Kurumi kuva

Hi,

Are you using maven or source codes from GitHub?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

tirpromaut

source codes from GitHub. Windows 10

Kurumi
Käyttäjän Kurumi kuva

Hi,

Use maven or gradle if you can. Go gurux.serial.java\development\src\main\resources\Win64 and check is gurux.serial.java.dll there.

Are you using eclipse or Netbeans?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

tirpromaut

I have started in Linux. Data
are read in watts. It is possible
to read data in kilowatts?
Meter is Landis Gyr E550

Kurumi
Käyttäjän Kurumi kuva

Hi,

We are showing data what meter sends. You can configure meter to send data in kW or divide value in your app.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

hernan

What about the error? how it was solved? "Can't find dependent libraries"

In my case the error is at "System.load(file.getAbsolutePath());" in GXSerial file

The dll do exist and is located in the path.

Clue: The problem started after a windows 10 reinstall from scratch

Kurumi
Käyttäjän Kurumi kuva

Hi,

Are you using Eclipse or netbeans? I believe problem is that you your app is not found dll.
Easiest is if you use maven or gradle.

Can you run unit tests?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

hernan

The project was compiling right and running perfectly before windows and netbeans and jdk reinstall

Same problem with Maven, the dll file is there, perhaps it's a problem with 32/64 bits... I've installed netbeans with a jdk of 64 bits, perhaps use everything in 32...

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\User\AppData\Local\Temp\gurux.serial.java8306029990932563524.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at gurux.serial.GXSerial.initialize(GXSerial.java:316)
at gurux.serial.GXSerial.<init>(GXSerial.java:174)
at gurux.dlms.client.sampleclient.getManufactureSettings(sampleclient.java:172)
at gurux.dlms.client.sampleclient.main(sampleclient.java:67)

Kurumi
Käyttäjän Kurumi kuva

Hi,

I believe now we are close and you are right from this 32/64 bits. Your environment is 64 bit, but I can't remember is netbeans 64 or 32 bit. I just test this with Eclipse without problems.

I'll check this with NetBeans tomorrow.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

hernan

After a while... with help of "dependency walker", I found It

gurux.serial.java depends on msvcr100.dll and msvcp100.dll

I copied those files to Windows/System32, and it, finally, works

Kurumi
Käyttäjän Kurumi kuva

Hi Hernan,

Thanks from this info. We have to check is there any way to report if Microsoft Visual C++ Redistributables are not installed.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

Jackay

Hi Miko and Hernan,

I am using Landis Gyre E550 Energy meter, I need some of your help as you have communicated with the same meter. Please respond.

Regards,
Jack

Kurumi
Käyttäjän Kurumi kuva

Hi Jack,

Please create own topic if you have question.
You should download GXDLMSDirector and read your meter with that.
There are default settings what you can use.

Client address is 0x10
Server address is 0x1.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi