harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1022) [classlib][jndi] unexpected NoInitialContextException for new InitialContext().close() method
Date Tue, 01 Aug 2006 05:49:14 GMT
[classlib][jndi] unexpected NoInitialContextException for new InitialContext().close() method
---------------------------------------------------------------------------------------------

                 Key: HARMONY-1022
                 URL: http://issues.apache.org/jira/browse/HARMONY-1022
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vladimir Ivanov


The Harmony method javax.naming.InitialContext.close() throws javax.naming.NoInitialContextException
if object was create by InitailContext() constructor or by InitailContext(null) while RI work
silently.

================== test.java =====================
import javax.naming.*;

public class test {
   public static void main(String[] argv) {
        try {       
            new InitialContext().close();
            System.out.println("Test passed");
        } catch (InvalidNameException e) {
            System.out.println("Test passed: " + e);
        } catch (Throwable e) {
            System.out.println("Test failed: unexpected " + e);
            e.printStackTrace();
        }

        try {       
            new InitialContext(null).close();
            System.out.println("Test passed");
        } catch (InvalidNameException e) {
            System.out.println("Test passed: " + e);
        } catch (Throwable e) {
            System.out.println("Test failed: unexpected " + e);
            e.printStackTrace();
        }
    }
}
==============================================

Output:
C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp . -showversion test
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized
over throughput (initial strategy singleparpar))

Test passed
Test passed

C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -cp . -showversion test
java version 1.5 (subset)

(c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
Test failed: unexpected javax.naming.NoInitialContextException: Failed to create InitialContext
using factory specified in hashtable {} [Root exceptio
n is java.lang.NullPointerException]
javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified
in hashtable {}. The stack trace of the root exception
 is: java.lang.NullPointerException
        at java.lang.Class.forName(Class.java:157)
        at javax.naming.spi.NamingManager$1.run(NamingManager.java:790)
        at javax.naming.spi.NamingManager$1.run(NamingManager.java:787)
        at java.security.AccessController.doPrivileged(AccessController.java:177)
        at javax.naming.spi.NamingManager.classForName(NamingManager.java:785)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:248)
        at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:246)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:271)
        at javax.naming.InitialContext.close(InitialContext.java:478)
        at test.main(test.java:6)
Test failed: unexpected javax.naming.NoInitialContextException: Failed to create InitialContext
using factory specified in hashtable {} [Root exceptio
n is java.lang.NullPointerException]
javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified
in hashtable {}. The stack trace of the root exception
 is: java.lang.NullPointerException
        at java.lang.Class.forName(Class.java:157)
        at javax.naming.spi.NamingManager$1.run(NamingManager.java:790)
        at javax.naming.spi.NamingManager$1.run(NamingManager.java:787)
        at java.security.AccessController.doPrivileged(AccessController.java:177)
        at javax.naming.spi.NamingManager.classForName(NamingManager.java:785)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:248)
        at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:246)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:271)
        at javax.naming.InitialContext.close(InitialContext.java:478)
        at test.main(test.java:16)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message