kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
433 stars 114 forks source link

Exception in zlinux machine(s390x-Linux) #39

Closed praveenjala closed 7 years ago

praveenjala commented 7 years ago

Hi,

I am using docker-java(3.0.6) client to connect to Docker. When i am trying to connect in zlinux machine(s390x-Linux) i am getting error with following: Caused by: java.lang.RuntimeException: Unhandled architecture/OS: s390x-Linux mtcac_1 | at org.newsclub.net.unix.NarSystem.getAOLs(NarSystem.java:110) mtcac_1 | at org.newsclub.net.unix.NarSystem.loadLibrary(NarSystem.java:30)

Please find the complete log in the attached log file.

Can you please help me in resolving this as early as possible?

Thanks, Praveen. unixsockerror.txt

kohlschuetter commented 7 years ago

Hi Praveen,

s390x is an unsupported architecture (see the error message). You need to build a matching binary on/for your platform. (see the "junixsocket-native" Maven artifact) Let me know how that goes.

Cheers, Christian

praveenjala commented 7 years ago

Hi Christian,

Thanks a lot for you immediate reply. Do you want me to follow the steps given in this page https://code.google.com/archive/p/junixsocket/wikis/BuildingFromSource.wiki This page refers to build.xml, but i can find only pom.xml file.

How to update NarSystem.java file to include s390x-Linux?

Can you please give detail description of how to do?

Thanks, Praveen.

kohlschuetter commented 7 years ago

The Wiki on Google Code is outdated.

Please try the following:

  1. Checkout the source from https://github.com/kohlschutter/junixsocket
  2. mvn clean install -Pwith-native
  3. nar file should be in ~/.m2/repository//com/kohlschutter/junixsocket/junixsocket-native/2.0.5-SNAPSHOT/

If that works, check out the git tag corresponding to the version you want to use and try again

praveenjala commented 7 years ago

I have to build on zlinux machine, to generate the corresponding libs. Am i correct.

kohlschuetter commented 7 years ago

That would be preferable. I guess you could also build in an emulator or attempt cross-compilation. In any case, you're pretty much on your own here as I do not have access to such mainframes.

praveenjala commented 7 years ago

Hi Kohlschuetter,

I tried to build the jar by checking out the code from git. Initially i got the following error [‎6/‎5/‎2017 3:16 PM] Chakravarthula, Shivaramakrishna: [ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.2.0:nar-validate (default-nar-validate) on project junixsocket-native: NAR: One of two things may be wrong here: [ERROR] [ERROR] 1. tag is missing inside the tag of your NAR configuration [ERROR] [ERROR] 2. no linker is defined in the aol.properties file for 's390x.Linux.linker'

After adding the following lines to aol.properties file s390x.Linux.gpp.c.options=-Wall -Wno-long-long -Wpointer-arith -Wconversion -m64 -march=s390x s390x.Linux.gpp.cpp.options=-Wall -Wno-long-long -Wpointer-arith -Wconversion -m64 -march=s390x s390x.Linux.gpp.linker.options=-shared -shared-libgcc -fPIC -fexceptions -m64 -march=s390x s390x.Linux.linker=g++

I was able to build the jar file. But on opening the jar file "junixsocket-native-common-2.0.5-SNAPSHOT.jar" there is no lib directory in the jar file. Ideally there should be a lib directory containing the files which is present in 2.0.4 file.

I have attached the jar file. Please let me know what i am doing wro native-common-jarfile.zip ng as early as possible. Thanks, Praveen.

praveenjala commented 7 years ago

All the junit testcases are failing.

praveenjala commented 7 years ago

Hi Kohlschuetter,

Can you please let me know what i am doing wrong. I am struck.

Thanks, Praveen.

kohlschuetter commented 7 years ago

Modify junixsocket-native-common/pom.xml so it includes your nar.

praveenjala commented 7 years ago

Hi Kohlschuetter;,

I tried building with your suggestion. But i am not succesful.

I have attached a zip file containing the pom.xm and the output of the command.

Can you have a look and let me know what is work?

Now also no lib directory is not created containing the so files. Please help me sir i am struck.

Regards, Praveen

praveenjala commented 7 years ago

junixsocket.zip Attached the zip file.

kohlschuetter commented 7 years ago

Sorry, I don't have time to debug this right now.

You are trying to build on an unsupported architecture; junixsocket tells you this by throwing an exception "Unhandled architecture/OS: s390x-Linux".

kohlschuetter commented 5 years ago

For posterity: cross-compilation has become much easier with junixsocket 2.2.

see Cross-compiling junixsocket and Custom architectures for some information.