You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Rick Hillegas <Ri...@Sun.COM> on 2006/02/07 21:26:29 UTC

debug reading system properties in BaseMonitor

Hi Dan,

Could you help brainstorm a workaround for the following issue:

BaseMonitor, in a sane debug server, is calling System.getProperty() and 
getProperties() outside of a priv block. This raises a 
PropertyPermission exception when the EmbeddedDriver is loaded from a 
sane/debug jar file under jdk1.6. I notice this exception if I 
explicitly call Class.forName() on the EmbeddedDriver. However, I 
believe that this is also happening when the vm tries to autoload the 
driver at startup--I'm not sure because autoloading errors seem to be 
silently swallowed.

Would appreciate your advice about how to code around this for a unit test.

Thanks,
-Rick

Re: debug reading system properties in BaseMonitor

Posted by Rick Hillegas <Ri...@Sun.COM>.
Sweet. This fixes the problem.

Thanks,
-Rick

Daniel John Debrunner wrote:

>Rick Hillegas wrote:
>  
>
>>Hi Dan,
>>
>>Could you help brainstorm a workaround for the following issue:
>>
>>BaseMonitor, in a sane debug server, is calling System.getProperty() and
>>getProperties() outside of a priv block. This raises a
>>PropertyPermission exception when the EmbeddedDriver is loaded from a
>>sane/debug jar file under jdk1.6. I notice this exception if I
>>explicitly call Class.forName() on the EmbeddedDriver. However, I
>>believe that this is also happening when the vm tries to autoload the
>>driver at startup--I'm not sure because autoloading errors seem to be
>>silently swallowed.
>>    
>>
>
>I think this is DERBY-623
>
>http://issues.apache.org/jira/browse/DERBY-623
>
>The easiest thing to do would be to fix 623, it's simple.
>
>I think your test is failing while others (I assume) run under jdk16 and
>the security manager because it's a junit test. As the comments to 623
>state the permissions are needed all the way up the stack, and these
>permissions are not granted to the junit jar file by the testing policy
>file.
>
>Dan.
>  
>


Re: debug reading system properties in BaseMonitor

Posted by Daniel John Debrunner <dj...@apache.org>.
Rick Hillegas wrote:
> Hi Dan,
> 
> Could you help brainstorm a workaround for the following issue:
> 
> BaseMonitor, in a sane debug server, is calling System.getProperty() and
> getProperties() outside of a priv block. This raises a
> PropertyPermission exception when the EmbeddedDriver is loaded from a
> sane/debug jar file under jdk1.6. I notice this exception if I
> explicitly call Class.forName() on the EmbeddedDriver. However, I
> believe that this is also happening when the vm tries to autoload the
> driver at startup--I'm not sure because autoloading errors seem to be
> silently swallowed.

I think this is DERBY-623

http://issues.apache.org/jira/browse/DERBY-623

The easiest thing to do would be to fix 623, it's simple.

I think your test is failing while others (I assume) run under jdk16 and
the security manager because it's a junit test. As the comments to 623
state the permissions are needed all the way up the stack, and these
permissions are not granted to the junit jar file by the testing policy
file.

Dan.