Search code examples
javalinuxcentos7opensplice

Wrong ELF class: How does one successfully install OpenSpliceDDS?


I've been trying to install and successfully run OpenSplice DDS on CentOS, The initial objective is to get it installed and run the HelloWorld Example (In Java),I did make the files necessary, using make, the compilation stage for subscriber and publisher steps which require compilation (of .jar) is very presistant, I've been working on this for almost 2-3 weeks, the problem is, there is very few documents and/ or resources discussing issues related to DDS installation(and there are many), I also tried to consult with my professor, he hinted to me that this could be a compatibility problem,sometime when I fix one issue with this installation another issue comes up, below is my current output:

[root@localhost standalone]# java -jar saj_helloworld_sub.jar 
OpenJDK 64-Bit Server VM warning: You have loaded library /root/Downloads/HDE/x86.linux/lib/libdcpssaj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
org.opensplice.dds.dcps.DomainParticipantFactoryImpl.get_instance() failed: /root/Downloads/HDE/x86.linux/lib/libdcpssaj.so: /root/Downloads/HDE/x86.linux/lib/libdcpssaj.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
Exception in thread "main" java.lang.NullPointerException
    at DDS.DomainParticipantFactory.create_participant(Unknown Source)
    at DDSEntityManager.createParticipant(DDSEntityManager.java:67)
    at HelloWorldDataSubscriber.main(HelloWorldDataSubscriber.java:38)

Java Version:

# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

System Details :

# uname -a

Linux localhost.localdomain 3.10.0-327.36.1.el7.x86_64 #1 SMP Sun Sep 18 13:04:29 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

So, the wrong ELF class is one of the possible errors that I may get,the difficulty of getting DDS installed and working correctly is not encountered only by me alone, some other friends of mine also having different errors,and since no resources and discussions exist online about OpenSplice DDS installation(except the official website and the readme file), i decided to open this discussion.


Solution

  • You're running a 64bit operating system - the x86_64 indicates this.

    You're running a 64bit java VM - OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

    You've got a 32-bit library: /root/Downloads/HDE/x86.linux/lib/libdcpssaj.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

    The simplest workaround is to download the 64bit version of OpenSplice DDS to get past this issue.