United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6931566 NetworkInterface is not working when interface name is more than 15 characters long
JDK-6931566 : NetworkInterface is not working when interface name is more than 15 characters long

Details
Type:
Bug
Submit Date:
2010-03-03
Status:
Closed
Updated Date:
2014-04-16
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
core-libs
OS:
solaris_10
Sub-Component:
java.net
CPU:
sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u18
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0_18-ea"
Java(TM) SE Runtime Environment (build 1.6.0_18-ea-b05)
Java HotSpot(TM) Server VM (build 16.0-b12, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
SunOS 5.10 Generic_138888-06 sun4v sparc SUNW,Sun-Blade-T6320

A DESCRIPTION OF THE PROBLEM :
We are trying to use jdk1.6.0_18 with Weblogic 11gR1 (10.3.2).

The environment requires configuring a Virtual IP through Veritas Cluster into one of the Solaris 10 local zones.
As soon as the Virtual IP is plumbed in, the Weblogic server fails to come up and the following error is shown.

<BEA-000386> <Server subsystem failed. Reason: java.lang.AssertionError: An error occurred while retrieving the n
etwork addresses for this machine. The most likely cause is an error in the network configuration of this machine.
java.lang.AssertionError: An error occurred while retrieving the network addresses for this machine. The most likely cause is
an error in the network configuration of this machine.
at weblogic.server.channels.AddressUtils$AddressMaker.getAllAddresses(AddressUtils.java:89)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:47)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:117)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
at weblogic.cluster.ClusterService.startService(ClusterService.java:102)
at weblogic.server.ServiceActivator.start(ServiceActivator.java:98)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

Caused By: java.net.SocketException: No such device or address
at java.net.NetworkInterface.getAll(Native Method)
at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:282)
at weblogic.server.channels.AddressUtils$AddressMaker.getAllAddresses(AddressUtils.java:57)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:47)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:117)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
at weblogic.cluster.ClusterService.startService(ClusterService.java:102)
at weblogic.server.ServiceActivator.start(ServiceActivator.java:98)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

The issue has been found to be with one of the core jdk methods...

public static void main(String args[]) throws Exception {
Enumeration niEnum = NetworkInterface.getNetworkInterfaces();


This method fails whenever there is a Virtual IP plumbed into the Solaris container with jdk1.6
The server is able to start without any exception on the container IP as soon as the VIP is unplumbed.

So getNetworkInterfaces is not able to report back Virtual IP addresses on the local zones.


REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
PUBLIC COMMENTS

1) Can you please get the output of 'ifconfig -a' from the zone in which the problem
   occurs?
2) Can you please clarify what is meant by 'local zone'. Is this the global zone, or is
   it a non-global zone?
                                     
2010-03-03
EVALUATION

The NetworkInterface implementation uses ifreq structure to enumerate interfaces but the length of ifname field is limited to 15 chars by the OS and if an interface has the longer name it's truncated. see /usr/include/net/if.h:

  struct    ifreq {
  #define IFNAMSIZ    16
    char    ifr_name[IFNAMSIZ];     /* if name, e.g. "en0" */
        ........ 

Example:
 'e1000g1174004:27' gets truncated to 'e1000g1174004:2' (missing the trailing '7')
                                     
2010-04-08



Hardware and Software, Engineered to Work Together