# Java libnio.so NET\_Bind not defined in file libnet.so

**URL:** <https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999>\
**Category:** SLES for System Z\
**Created:** [May 24, 2013, 7:58pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999 "2013-05-24T19:58:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![summitflier](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@summitflier](https://forums.suse.com/u/summitflier)\
**Post date:** [May 24, 2013, 7:58pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/1 "2013-05-24T19:58:06Z")

</div>

I run this same application on both x86\_64 and s390x servers, but I only see this error on the s390x side for some reason.

Exception in thread “main” java.lang.NoClassDefFoundError: sun.util.calendar.ZoneInfoFile (initialization failure)  
at java.lang.J9VMInternals.initialize(J9VMInternals.java:176)  
at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:675)  
at java.util.TimeZone.getTimeZone(TimeZone.java:592)  
at java.util.TimeZone.setDefaultZone(TimeZone.java:725)  
at java.util.TimeZone.getDefaultRef(TimeZone.java:656)  
at java.util.TimeZone.getDefault(TimeZone.java:643)  
at org.joda.time.DateTimeZone.getDefault(DateTimeZone.java:149)  
at org.jruby.RubyTime.getLocalTimeZone(RubyTime.java:151)  
at org.jruby.RubyTime$5.allocate(RubyTime.java:230)  
at org.jruby.RubyClass.allocate(RubyClass.java:224)  
at org.jruby.RubyTime.newInstance(RubyTime.java:924)  
at org.jruby.RubyTime$INVOKER$s$0$0$newInstance.call(RubyTime$INVOKER$s$0$0$newInstance.gen)  
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)  
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)  
at logstash.runner. **file** (logstash/runner.rb:2)  
at logstash.runner.load(logstash/runner.rb)  
at logstash.runner.main(logstash/runner.rb)  
Caused by: java.lang.UnsatisfiedLinkError: nio (/usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnio.so: symbol NET\_Bind, version SUNWprivate\_1.1 not defined in file libnet.so with link time reference)

server:/opt/logstash # strings /usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnet.so | grep NET  
NET\_Wait  
NET\_SockaddrEqualsInetAddress  
NET\_SockaddrToInetAddress  
NET\_SetTrafficClass  
NET\_GetPortFromSockaddr  
NET\_Bind  
NET\_MapSocketOption  
NET\_SetSockOpt  
NET\_GetSockOpt  
NET\_AllocSockaddr  
NET\_InetAddressToSockaddr  
IOCTL SIOCGIFNETMASK failed

server:/opt/logstash # strings /usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnet.so | grep SUN  
SUNWprivate\_1.1

Is there any reason why this library would act differently?

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [May 25, 2013, 1:42am UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/2 "2013-05-25T01:42:34Z")

</div>

Gotta hand it to you; you’ve tried everything I would have thought to do  
except I would have used ‘nm’ instead of ‘strings’ to list symbols. Does  
that matter? Probably not, but may be worth checking.

Assuming you’re using the default IBM JRE on the other SLES boxes maybe  
this is just a difference in Java on s390x, though that’s not supposed to  
happen, especially considering what you’ve shown us.

Still looking…

Good luck.

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [May 27, 2013, 2:47pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/3 "2013-05-27T14:47:17Z")

</div>

Could you confirm the Java vendor on the x86\_64 systems is also IBM (not  
Sun)? Do you by chance have some sample code that you know causes this  
path to be taken that could be shared?

Good luck.

---

<div class="post-metadata">

**Author:** ![summitflier](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@summitflier](https://forums.suse.com/u/summitflier)\
**Post date:** [May 28, 2013, 6:48pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/4 "2013-05-28T18:48:24Z")

</div>

server:~ # java -fullversion  
java full version JRE 1.7.0 IBM Linux build pxz6470sr4fp1-20130325\_01(SR4 FP1)

server:~ # java -version  
java version “1.7.0”  
Java™ SE Runtime Environment (build pxz6470sr4fp1-20130325\_01(SR4 FP1))  
IBM J9 VM (build 2.6, JRE 1.7.0 Linux s390x-64 Compressed References 20130306\_14 0761 (JIT enabled, AOT enabled)  
J9VM - R26\_Java726\_SR4\_FP1\_20130306\_1011\_B140761  
JIT - r11.b03\_20130131\_32403ifx1  
GC - R26\_Java726\_SR4\_FP1\_20130306\_1011\_B140761\_CMPRSS  
J9CL - 20130306\_140761)  
JCL - 20130315\_01 based on Oracle 7u13-b08

The code is a jar file.  
[http://logstash.net/](http://logstash.net/) (Download) logstash-1.1.12-flatjar.jar  
It requires that ruby and libyaml be installed. These don’t seem to be the problem.

server:~ # nm /usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnet.so | grep NET  
000000000000eef4 t NET\_Accept  
000000000000bd4c T NET\_AllocSockaddr  
000000000000add4 T NET\_Bind  
000000000000e2fc t NET\_Connect  
000000000000da38 t NET\_Dup2  
000000000000ab68 t NET\_GetFileDescriptorID  
000000000000abe8 T NET\_GetPortFromSockaddr  
000000000000afe0 T NET\_GetSockOpt  
000000000000d818 t NET\_GetThreadTag  
000000000000ac40 t NET\_IPv4MappedToIPv4  
000000000000c334 T NET\_InetAddressToSockaddr  
000000000000d7bc t NET\_Interrupt  
000000000000d798 t NET\_IsBlocked  
000000000000ac70 t NET\_IsEqual  
000000000000abf4 t NET\_IsIPv4Mapped  
000000000000ae2c T NET\_MapSocketOption  
000000000000e0c0 t NET\_Poll  
000000000000e84c t NET\_Read  
000000000000ecd0 t NET\_ReadV  
000000000000ea70 t NET\_RecvFrom  
000000000000de88 t NET\_Send  
000000000000f170 t NET\_SendTo  
000000000000af28 T NET\_SetSockOpt  
000000000000abc8 T NET\_SetTrafficClass  
000000000000a2f8 T NET\_SockaddrEqualsInetAddress  
000000000000a534 T NET\_SockaddrToInetAddress  
000000000000dd08 t NET\_Socket  
000000000000da28 t NET\_SocketClose  
000000000000c180 t NET\_ThrowByNameWithLastError  
000000000000c14c t NET\_ThrowCurrent  
000000000000c08c t NET\_ThrowNew  
000000000000e520 t NET\_Timeout  
000000000000acf4 T NET\_Wait  
000000000000f3c4 t NET\_WriteV  
000000000000acc8 t NET\_addrtransAvailable

server:~ # nm /usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnet.so | grep SUNW  
U JCL\_Accept@@SUNWprivate\_1.1  
U JCL\_Bind@@SUNWprivate\_1.1  
U JCL\_Close@@SUNWprivate\_1.1  
U JCL\_Connect@@SUNWprivate\_1.1  
U JCL\_Dup2@@SUNWprivate\_1.1  
U JCL\_Listen@@SUNWprivate\_1.1  
U JCL\_Poll@@SUNWprivate\_1.1  
U JCL\_ReadV@@SUNWprivate\_1.1  
U JCL\_Recv@@SUNWprivate\_1.1  
U JCL\_RecvFrom@@SUNWprivate\_1.1  
U JCL\_Send@@SUNWprivate\_1.1  
U JCL\_SendTo@@SUNWprivate\_1.1  
U JCL\_Shutdown@@SUNWprivate\_1.1  
U JCL\_Socket@@SUNWprivate\_1.1  
U JCL\_Socketpair@@SUNWprivate\_1.1  
U JCL\_WriteV@@SUNWprivate\_1.1  
U JNU\_GetStringPlatformChars@@SUNWprivate\_1.1  
U JNU\_NewObjectByName@@SUNWprivate\_1.1  
U JNU\_NewStringPlatform@@SUNWprivate\_1.1  
U JNU\_ReleaseStringPlatformChars@@SUNWprivate\_1.1  
U JNU\_ThrowByName@@SUNWprivate\_1.1  
U JNU\_ThrowByNameWithLastError@@SUNWprivate\_1.1  
U JNU\_ThrowIOException@@SUNWprivate\_1.1  
U JNU\_ThrowIOExceptionWithLastError@@SUNWprivate\_1.1  
U JNU\_ThrowNullPointerException@@SUNWprivate\_1.1  
U JNU\_ThrowOutOfMemoryError@@SUNWprivate\_1.1  
0000000000000000 A SUNWprivate\_1.1  
U dbgCalloc@@SUNWprivate\_1.1  
U dbgFree@@SUNWprivate\_1.1  
U dbgMalloc@@SUNWprivate\_1.1  
U dbgRawFree@@SUNWprivate\_1.1  
U dbgRawMalloc@@SUNWprivate\_1.1  
U dbgRealloc@@SUNWprivate\_1.1

---

<div class="post-metadata">

**Author:** ![summitflier](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@summitflier](https://forums.suse.com/u/summitflier)\
**Post date:** [May 28, 2013, 9:30pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/5 "2013-05-28T21:30:10Z")

</div>

I upgraded to SDK SP3, and that helped some, now I’m getting a different error.

Problem: nothing provides libyaml-0-2 = 0.1.3 needed by libyaml-devel-0.1.3-0.6.16.s390x  
It turns out, libyaml is on OBS for x86\_64, but nothing for s390x

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [June 25, 2013, 4:55pm UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/6 "2013-06-25T16:55:21Z")

</div>

Sorry for the delay. Some alpha geek went crazy with strace and has this  
analysis:

I ran an strace on this and found that there is a libnet.so in the /lib64 directory that was being referenced instead of the /usr/lib64/jvm/ java-1.7.0-ibm-1.7.0/jre/lib/s390x/libnet.so ...

The /lib64/libnet.so does not have the NET\_Bind defined, thus the error.

It can be fixed by putting /usr/lib64/jvm/java-1.7.0-ibm-1.7.0/jre/lib/  
s390x in the /etc/ld.so.conf file before the /lib and /lib64 entries,  
then run ldconfig.

Care to try and let us know? Note that modifying things in  
/etc/ld.so.conf\* can affect system behavior; in this case, I assume that’s  
desired. There are also other ways of implementing this change I believe,  
like setting LD\_LIBRARY\_PATH before calling Java (or at least that SHOULD  
work), or using LD\_PRELOAD.

Also note that this appears to address your original issue, so I’m not  
sure how things will be now that you have an issue with libyaml. I’m  
hoping somehow this will help that too.

Good luck.

---

<div class="post-metadata">

**Author:** ![summitflier](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@summitflier](https://forums.suse.com/u/summitflier)\
**Post date:** [July 12, 2013, 1:23am UTC](https://forums.suse.com/t/java-libnio-so-net-bind-not-defined-in-file-libnet-so/23999/7 "2013-07-12T01:23:21Z")

</div>

Yes this fixed it. In my case, I just relinked the libraries. I would have thought them to be identical.
