Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: wbe server on rpi

wbe server on rpi 2 months 3 weeks ago #11387

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 871
  • Karma: 0
Hi all,
I'm trying to configure a proview web server on my rpi4 and encounter the following issue at startup:
I Starting pwr_websocketserver, file: rt_websocketserver.sh, prio: 15
I Started pwr_websocketserver_1, prio: 15, pid: 2773
  file: rt_websocketserver.sh
I Not starting pwr_opc_server, file: opc_server
I Starting pwr_statussrv, file: rt_statussrv, prio: 15
I Started pwr_statussrv_1, prio: 15, pid: 2774
  file: rt_statussrv
I Not starting pwr_post, file: rt_post
I Not starting pwr_report, file: rt_report
I Not starting pwr_sevhistmon, file: rt_sevhistmon
I Not starting pwr_sev_server, file: sev_server
I Not starting pwr_sev_import, file: sev_import
I Not starting pwr_powerlink, file: rt_powerlink
I Not starting pwr_videomgm, file: rt_videomgm
I Not starting pwr_redcom, file: rt_redcom
I Not starting pwr_sim, file: rt_sim
I Adding application. aix: 1
I Starting pwr_plc_plc, file: plc_raspberrypi_0001_plc, prio: 5
I Started pwr_plc_plc_1_0, prio: 5, pid: 2781
  file: plc_raspberrypi_0001_plc
java.library.path = /usr/pwr59/os_linux/hw_arm/exp/exe:/usr/java/packages/lib:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so: : cannot open shared object file: No such file or directory
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
	at java.base/java.lang.System.loadLibrary(System.java:1873)
	at jpwr.rt.Gdh.<clinit>(Gdh.java:52)
	at jpwr.rt.GdhWebSocketServer.openServerSocket(GdhWebSocketServer.java:350)
	at jpwr.rt.GdhWebSocketServer.main(GdhWebSocketServer.java:253)
I Process pwr_elog_1 exited with status 256
I Process pwr_websocketserver_1 exited with status 256

pwrp@raspberrypi:~ $ su pi
Password: 
pi@raspberrypi:/home/pwrp $ ls /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so
/usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so
pi@raspberrypi:/home/pwrp $ ls -l /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so
-rwxr-xr-x 1 pwrp pwrp 10392496 Dec  3 20:50 /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so

Could you help me to point to the root cause of this: The file exists in $pwr_exe and belong to user pwrp but apparently it's not able to open it ?

Note: I have installed the default-jdk (11) on rpi

Thanks
Snarf
The administrator has disabled public write access.

wbe server on rpi 2 months 3 weeks ago #11389

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2961
  • Karma: 0
Hi Snarf,


I can't say what's wrong. Maybe if show you my environment you can find some differences.

I have installed openjdk-11-jdk on rpios 10.

>ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Dec 3 23:21 /usr/bin/java -> /etc/alternatives/java

> ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 43 Dec 3 23:21 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-armhf/bin/java


Permissions on the so-file

> ls -l $pwr_exe/libjpwr*.so
-rwxr-xr-x 1 pwrp pwrp 10392496 Dec 3 20:50 /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so


When I have logged in as user pwrp and attached a project the websocketserver starts with

> export LD_LIBRARY_PATH=$pwr_exe
> export CLASSPATH=$pwr_lib/pwr_rt.jar:$pwr_lib/pwr_jop.jar
> java jpwr.rt.GdhWebSocketServer

/Claes
The administrator has disabled public write access.

wbe server on rpi 2 months 2 weeks ago #11390

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 871
  • Karma: 0
Hi Claes,
Thanks for sharing you config.
Unfortunately I can't see any particular difference between our environment so far:
pi@raspberrypi:~ $ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Apr  3 14:02 /usr/bin/java -> /etc/alternatives/java

pi@raspberrypi:~ $ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 43 Apr  3 14:02 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-armhf/bin/java

pwrp@raspberrypi:/home/pi $ ls -l $pwr_exe/libjpwr*.so
-rwxr-xr-x 1 pwrp pwrp 10392496 Dec  3 20:50 /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so

For the rest, when you say you "attached" to the project you mean simply with sdf, right ?
Because in my case, I didn't plan to install the full dev pacakge on pi but only the runtime. Indeed I did by mistake install pwr59 full package first, but then I removed it and reinstalled the pwr59rt as desired.
Perhaps this double install has jeoparized some env variable ?
Do you think it worths re installing everything ?

Secondly, in case it should work correctly with only pwrrt installed (I guess, right ?), should I have anyway the Ld_LIBRARY_PATH and the CLASSPATH declared ? because I don't have them declared at the moment even when logged as pwrp on the rpi.


At last I tested to preset those vairable manually by exporting LD_LIBRARY_PATH and CLASSPATH with your links and then re launching:
pwrp@raspberrypi:/home/pi $  java jpwr.rt.GdhWebSocketServer

but error is same:
pwrp@raspberrypi:/home/pi $ java jpwr.rt.GdhWebSocketServer
java.library.path = /usr/pwr59/os_linux/hw_arm/exp/exe:/usr/java/packages/lib:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/pwr59/os_linux/hw_arm/exp/exe/libjpwr_rt_gdh.so: : cannot open shared object file: No such file or directory
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
	at java.base/java.lang.System.loadLibrary(System.java:1873)
	at jpwr.rt.Gdh.<clinit>(Gdh.java:52)
	at jpwr.rt.GdhWebSocketServer.openServerSocket(GdhWebSocketServer.java:350)
	at jpwr.rt.GdhWebSocketServer.main(GdhWebSocketServer.java:253)

Thanks for your help
Snarf
The administrator has disabled public write access.

wbe server on rpi 2 months 2 weeks ago #11391

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2961
  • Karma: 0
Hi Snarf,

I saw that $pwr_exe pointed to /usr/pwr59..., and that is where the pwr59 package is installed so I concluded that it was a development station. And this is actually the problem because in a rt station $pwr_exe should point to /usr/pwrrt/exe. I reason is probably that you still have the /etc/pwrp_profile from the pwr59 package. You could try to change the pwr_ environment variables in the .bashrc file for pwrp (/home/pwrp/.bashrc) by inserting the exports below and see if this works.

export pwr_exe=/usr/pwrrt/exe
export pwr_obj=/usr/pwrrt/obj
export pwr_lib=/usr/pwrrt/lib
export pwr_doc=/usr/pwrrt/doc
export pwr_load=/usr/pwrrt/load
export pwr_inc=/usr/pwrrt/inc
export pwr_web=/usr/pwrrt/web

You don't need to define LD_LIBRARY_PATH or CLASSPATH. This is done by the start script for the websockerserver.

/Claes
The administrator has disabled public write access.

wbe server on rpi 2 months 2 weeks ago #11392

  • Snarf77
  • Snarf77's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 871
  • Karma: 0
Thank you very much Claes

It's working now after having added your export lines in the .bashrc

Thanks a lot
Snarf
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.559 seconds