harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Qiu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4303) [classlib][sql] java.sql.DriverManager.getDrivers() will read System prpperty "jdbc.drivers" cause java.lang.ExceptionInInitializerError
Date Fri, 29 Jun 2007 08:37:04 GMT
[classlib][sql] java.sql.DriverManager.getDrivers() will read System prpperty "jdbc.drivers"
cause java.lang.ExceptionInInitializerError
----------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4303
                 URL: https://issues.apache.org/jira/browse/HARMONY-4303
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: WIndows
Red Hat
            Reporter: Sean Qiu


getDrivers method of DriverManager will read System property "jdbc.drivers".
That will  cause java.lang.ExceptionInInitializerError for lack of permission by default.

public class Test {
	public static void main(String[] args) {
		System.setSecurityManager(new SecurityManager());
		try {
			Enumeration<Driver> drivers = DriverManager.getDrivers();
			while (drivers.hasMoreElements()) {
				Driver driver = drivers.nextElement();
			}
		} catch (Error e) {
			e.printStackTrace();
		}
	}
}

In RI:  Pass
In Harmony: Throw a java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:195)
	at Test.main(Test.java:13)
Caused by: java.security.AccessControlException: Access denied (java.util.PropertyPermission
jdbc.drivers read)
	at java.security.AccessController.checkPermission(AccessController.java:94)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:746)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:373)
	at java.lang.System.getProperty(System.java:675)
	at java.sql.DriverManager.loadInitialDrivers(DriverManager.java:73)

	at java.sql.DriverManager.<clinit>(DriverManager.java:65)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
	... 1 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message