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 Ramin Moazeni <rm...@gmail.com> on 2007/07/16 18:32:48 UTC

Regarding DERBY-2925 and java.security.AccessControlException

Hello

After implementing the change to fix this bug, I am getting
the following errors when running the derbyall tests:
call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'T1' , 'extinout/t1.dump' ,
                                    '|','''', 'ASCII') ;
ERROR XJ001: Java exception: 'java.security.AccessControlException:
access denied (java.io.FilePermission extinout/t1.dump read)'.
ERROR XJ001: Java exception: 'access denied (java.io.FilePermission
extinout/t1.dump read): java.security.AccessControlException'.

and

call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select user_id from users' ,
                    'extinout/users_id.dat', null , null , null ) ;
ERROR XJ001: Java exception: 'java.security.AccessControlException:
access denied (java.io.FilePermission extinout/users_id.dat read)'.
ERROR XJ001: Java exception: 'access denied (java.io.FilePermission
extinout/users_id.dat read): java.security.AccessControlException'.

Copy and pasting the statements into ij does not result in any errors. Here is
how I am running the test:
 java org.apache.derbyTesting.functionTests.harness.RunTest
tools/importExportThruIJ.sql

with this email, I am attaching the diff output (DERBY-2925.diff) as
well as the test
output (importExportThruIJ.out).

The exceptions does not have any stacktrace so that I can trace it to
the problematic
part of the code. Any assistance is appreciated.

Please note that I have not yet added my tests to the
importExportThruIJ.sql and I am using the original
importExportThruIJ.sql test file.

Thanks
Ramin

Re: Regarding DERBY-2925 and java.security.AccessControlException

Posted by Myrna van Lunteren <m....@gmail.com>.
Ramin,

There's nothing wrong with the test when I run it, so the problem must
be in the code that you did change...If you back out your changes, or
check in a clean svn tree, you probably won't see this either. You
probably did a read of a file, or accessing some system property that
is not within a 'privileged block', which is needed because the tests
run with a SecurityManager installed.

See for info on privileged blocks
http://java.sun.com/j2se/1.4.2/docs/guide/security/doprivileged.html

See for a helpful derby utility for accessing files the class:
org.apache.derby.iapi.util.PrivilegedFileOps.

HTH
Myrna