db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: How to start and stop Derby from within a test
Date Wed, 29 Mar 2006 17:47:24 GMT
Olav Sandstaa wrote:

...

>I also had to disable the use of the security manager for the
>test. With security manager, the last call to ij.startJBMS() gets the
>following exception:
>
>   Unexpected exception: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE:
XJ040, SQLERRMC: Failed to start database 'wombat', see the next exception for details.::SQLSTATE:
XJ001Java exception: 'access denied (java.io.FilePermission /export/home/tmp/derbyjdbc4/DerbyNetClient/TestConnectionMethods/wombat/log/logmirror.ctrl
read): java.security.AccessControlException'.
>
>I do not know why, but disabling the security manager made this go
>away. I probably should find a better way to get around this.
>
>  
>
Somewhere in the test output there should be a detailed stack trace for 
this exception (you may have to run the test with verbose=true).  That 
stack trace will point you at a piece of code which may need to be 
wrapped in a privileged block. You can grep the codeline for 
"AccessController.doPrivileged" for example of how to code one of these. 
You may also need to add some permissions to the policy file used by 
derbyall tests: derby_tests.policy.

Mime
View raw message