Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5042453
Votes 0
Synopsis Ipv6 address throws Non-numeric port number error
Category jndi:cosnaming
Reported Against tiger
Release Fixed mustang(b49)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 05-MAY-2004
Description

OPERATING SYSTEM(S):
Red Hat Enterprise Linux AS release 3 (Taroon Update 1) and Windows XP.

JAVA VERSION:
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b37)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b37, mixed mode)


When trying to use IPv6 loopback address (::1) in java.naming.provider.url 

	eg) -Djava.naming.provider.url=iiop://[::1]:2809

The following exception is thrown:
Trouble: javax.naming.ConfigurationException: Nonnumeric port number: [::1]:2809
javax.naming.ConfigurationException: Nonnumeric port number: [::1]:2809
        at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:302)
        at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
        at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
        at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
        at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
        at javax.naming.InitialContext.init(InitialContext.java:219)
        at javax.naming.InitialContext.<init>(InitialContext.java:175)
        at HelloServer.main(HelloServer.java:12)

Result:
Unable to run ORB tests with IPv6 address in numeric format.

Expected Result:
Should be able to process the IPv6 address in numeric format without any error/exception.

Steps to Recreate:
1) On a Windows XP Service pack 1, do the followign to enable IPv6.
	Open a command prompt
	Type ipv6 install
	You should see the following
		D:\svt\ipv6\test>ipv6 install
		Installing...
		Succeeded.
	Type ping ::1  .You should see

		D:\svt\ipv6\test>ping ::1

		Pinging ::1 with 32 bytes of data:

		Reply from ::1: time<1ms
		Reply from ::1: time<1ms
		Reply from ::1: time<1ms
		Reply from ::1: time<1ms

		Ping statistics for ::1:
		    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
		Approximate round trip times in milli-seconds:
		    Minimum = 0ms, Maximum = 0ms, Average = 0ms

	This is to confirm IPv6 loopback is responding.

2) Download and unjar test.jar
3) set CLASSPATH=.
4) javac *.java
5) rmic -iiop HelloImpl
6) start tnameserv -J-Djava.net.preferIPv4Stack=false -ORBInitialPort 2809
7) Start the server:
	java -Djava.net.preferIPv4Stack=false  -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory 
	-Djava.naming.provider.url=iiop://[::1]:2809 -Dcom. customer .CORBA.Debug=true -Dcom. customer .CORBA.CommTrace=true HelloServer

To recreate the problem on Linux follow steps from 2 to 7 on a machine which has IPv6 enabled.

TEST.JAR:
Hello.java:
import java.rmi.RemoteException;
import java.util.*;

public interface Hello extends java.rmi.Remote {
    public String sayHello() throws RemoteException;
}

HelloClient.java:
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import javax.naming.NamingException;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import java.util.*;

public class HelloClient {
    public static void main(String[] args) {
        Object objectRef=null;
        try {
                Context context = new InitialContext();
                objectRef=context.lookup("HelloServer");
                Hello hello =(Hello) PortableRemoteObject.narrow(objectRef, Hello.class);
                System.out.println(hello.sayHello());
        } catch (Throwable t) {
                t.printStackTrace();
        }
    }
}

HelloServer.java:
//HelloServer.java
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;

public class HelloServer {
    public static void main(String[] args) {
        try {
            
            Hello server = new HelloImpl();
            Context initialNamingContext = new InitialContext();
            initialNamingContext.rebind("HelloServer", server );
            System.out.println("Hello Server: Ready...");
         } catch (Exception e) {
            System.out.println("Trouble: " + e);
            e.printStackTrace();
         } 
     }
}

HelloImpl.java:
import javax.rmi.PortableRemoteObject;
import java.rmi.RemoteException;
import java.util.*;
import java.math.*;

public class HelloImpl extends PortableRemoteObject implements Hello 
{
    public HelloImpl() throws RemoteException
    {
        super();
    }
    public String sayHello() {
        return "hello";
    }
}


======================================================================
Posted Date : 2005-08-20 00:23:32.0
Work Around
N/A
Evaluation
The current URL format that the cosnaming service provider uses conforms to the URL syntax defined in Interoperable Naming Server (INS) specification, OMG TC Document orbos/98-10-11. 
The cosnaming service provider must be enhanced to handle the IPv6 literal addresses in the IIOP URL.

  xxxxx@xxxxx   2004-05-13
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang