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] Commented: (HARMONY-4303) [classlib][sql] java.sql.DriverManager.getDrivers() will read System prpperty "jdbc.drivers" cause java.lang.ExceptionInInitializerError
Date Fri, 06 Jul 2007 02:13:04 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510552
] 

Sean Qiu commented on HARMONY-4303:
-----------------------------------

Thanks leo
Verify by Sean at r553376.

> [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
>            Assignee: Leo Li
>         Attachments: Harmony-4303.zip
>
>
> 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