gurux.dlms.client.example (Serial)

18 posts / 0 new
Last post
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
kurumi's picture
gurux.dlms.client.example (Serial)

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

sierra002
thanks Mikko

thanks Mikko

kurumi
kurumi's picture
gurux.dlms.client.example (Serial)

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

spark_
gurux.serial

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
kurumi's picture
gurux.serial

Hi,

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

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

tirpromaut
the same problem

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
kurumi's picture
gurux.serial

Hi,

Are you using maven or source codes from GitHub?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

tirpromaut
source codes from GitHub.

source codes from GitHub. Windows 10

kurumi
kurumi's picture
gurux.serial

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

tirpromaut
watt-kilowatt

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

kurumi
kurumi's picture
watt-kilowatt

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

hernan
java.lang.UnsatisfiedLinkError

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
kurumi's picture
Can't find dependent libraries

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

hernan
Using Netbeans,

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
kurumi's picture
Using Netbeans,

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org

hernan
Solved!

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
kurumi's picture
DLL

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
Hermiankatu 6-8 H 33720 TAMPERE, FINLAND
Phone: +358 3 265 1244
Home page: http://www.gurux.org