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 Manish Khettry <ma...@yahoo.com> on 2006/03/22 03:15:03 UTC

AccessControlException when running functional tests

I get this exception when I try to run a functional
test. 

$ cat views.out
RunIJ --> java.security.AccessControlException: access
denied (java.io.FilePermission
C:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
read)
java.security.AccessControlException: access denied
(java.io.FilePermission
C:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
read)

Any pointers as to what might be wrong. I reread the
instructions for running functional tests and I seem
to have setup things appropriately.

Here is the command line that I use to run a single
test.

java -classpath '...' -Duseprocess=false
-Dverbose=true
org.apache.derbyTesting.functionTests.harness.RunTest
lang/views.sql

The environment is cygwin/windows. Needless to say
when I tried to debug the test harness in the IDE it
seems to run fine. Sigh.

Thanks,
Manish





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: AccessControlException when running functional tests

Posted by Manish Khettry <ma...@gmail.com>.
Thanks Andrew and Myrna. I'm guessing, since nobody has seen this problem
before that there is something wrong in my dev environment. Here's what I've
found:

If I run with derbytools.jar in the classpath I get this exception. Without
derbytools.jar it works. Here is the classpath that works for me:

ds=c:/eclipse_workspace/derby/trunk
jardir=$ds/jars/sane
cp="$ds/tools/java/jakarta-oro-2.0.8.jar
;$ds/classes;$jardir/derbyTesting.jar"

SImply adding derbytools.jar to cp causes this exception.

The command line is:
java -classpath $cp -Duseprocess=false -Dverbose=true
org.apache.derbyTesting.functionTests.harness.RunTest $*

The complete stack trace (in the .tmp file) is

RunIJ --> java.security.AccessControlException: access denied (
java.io.FilePermissionC:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
read)
java.security.AccessControlException: access denied
(java.io.FilePermissionC:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
read)
        at java.security.AccessControlContext.checkPermission(
AccessControlContext.java:269)
        at java.security.AccessController.checkPermission(
AccessController.java:401)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java
:524)
        at java.lang.SecurityManager.checkRead(SecurityManager.java:863)
        at java.io.FileInputStream.<init>(FileInputStream.java:100)
        at java.io.FileInputStream.<init>(FileInputStream.java:66)
        at org.apache.derby.impl.tools.ij.util.getPropertyArg(util.java:120)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:91)
        at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)
        at org.apache.derby.tools.ij.main(ij.java:60)
        at org.apache.derbyTesting.functionTests.harness.RunIJ.run(
RunIJ.java:44)
        at java.lang.Thread.run(Thread.java:534)
java.security.AccessControlException: access denied (
java.util.PropertyPermission * read,write)
        at java.security.AccessControlContext.checkPermission(
AccessControlContext.java:269)
        at java.security.AccessController.checkPermission(
AccessController.java:
401)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java
:524)
        at java.lang.SecurityManager.checkPropertiesAccess(
SecurityManager.java:
1243)



On 3/22/06, Myrna van Lunteren <m....@gmail.com> wrote:
>
> On 3/21/06, Andrew McIntyre <mc...@gmail.com> wrote:
> >
> > On 3/21/06, Manish Khettry <ma...@yahoo.com> wrote:
> > >
> > > RunIJ --> java.security.AccessControlException: access
> > > denied (java.io.FilePermission
> > >
> > C:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
> > > read)
> > >
> > > </snip>
> > >
> > > java -classpath '...' -Duseprocess=false
> > > -Dverbose=true
> > > org.apache.derbyTesting.functionTests.harness.RunTest
> > > lang/views.sql
> >
> > I'm assuming '...' here means you've removed the actual contents of
> > classpath for brevity. Recently, there have been some issues with
> > running tests with useprocess=false. I'm guessing in this case that
> > the security manager is installed but the test harness could not find
> > the security policy (due to a security exception?) when running with
> > useprocess=false. What happens when you run with useprocess=true (or
> > just not setting useprocess)?
> >
> > I realize that if what you're trying to do is use a debugger during
> > the execution of the test that it doesn't help much if the test runs
> > properly with useprocess=true, but fails with useprocess=false. Any
> > information about how the tests fail when running with
> > useprocess=false will help to fix the issues that exist with testing
> > running in that mode, though.
> >
> > I think Myrna has been working with useprocess=false recently. She may
> > have more information about running tests in that mode.
> >
> > andrew
> >
>
>
> Saw my name...Yes, I did some work on useprocess=false, actually back in
> december and january, but that is more centered around getting networkserver
> and .java tests going and speeding up test suites. I ran into a snafu
> regarding classes (apparently for functions/ java stored procedures) not
> found and then I had to go work on something else, it's not ready to be
> checked in just yet.
>
> All that being said, I couldn't reproduce what you see using my classes
> dir in a simple shell...(i.e. outside the IDE). Did you try that?
> I must be missing a crucial detail. In your IDE - eclipse, apparently -
> did you use .jars for the classpath?
>
> Myrna
>

Re: AccessControlException when running functional tests

Posted by Myrna van Lunteren <m....@gmail.com>.
On 3/21/06, Andrew McIntyre <mc...@gmail.com> wrote:
>
> On 3/21/06, Manish Khettry <ma...@yahoo.com> wrote:
> >
> > RunIJ --> java.security.AccessControlException: access
> > denied (java.io.FilePermission
> > C:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
> > read)
> >
> > </snip>
> >
> > java -classpath '...' -Duseprocess=false
> > -Dverbose=true
> > org.apache.derbyTesting.functionTests.harness.RunTest
> > lang/views.sql
>
> I'm assuming '...' here means you've removed the actual contents of
> classpath for brevity. Recently, there have been some issues with
> running tests with useprocess=false. I'm guessing in this case that
> the security manager is installed but the test harness could not find
> the security policy (due to a security exception?) when running with
> useprocess=false. What happens when you run with useprocess=true (or
> just not setting useprocess)?
>
> I realize that if what you're trying to do is use a debugger during
> the execution of the test that it doesn't help much if the test runs
> properly with useprocess=true, but fails with useprocess=false. Any
> information about how the tests fail when running with
> useprocess=false will help to fix the issues that exist with testing
> running in that mode, though.
>
> I think Myrna has been working with useprocess=false recently. She may
> have more information about running tests in that mode.
>
> andrew
>


Saw my name...Yes, I did some work on useprocess=false, actually back in
december and january, but that is more centered around getting networkserver
and .java tests going and speeding up test suites. I ran into a snafu
regarding classes (apparently for functions/ java stored procedures) not
found and then I had to go work on something else, it's not ready to be
checked in just yet.

All that being said, I couldn't reproduce what you see using my classes dir
in a simple shell...(i.e. outside the IDE). Did you try that?
I must be missing a crucial detail. In your IDE - eclipse, apparently - did
you use .jars for the classpath?

Myrna

Re: AccessControlException when running functional tests

Posted by Andrew McIntyre <mc...@gmail.com>.
On 3/21/06, Manish Khettry <ma...@yahoo.com> wrote:
>
> RunIJ --> java.security.AccessControlException: access
> denied (java.io.FilePermission
> C:\eclipse_workspace\derby\trunk\java\testing\views\views_app.properties
> read)
>
> </snip>
>
> java -classpath '...' -Duseprocess=false
> -Dverbose=true
> org.apache.derbyTesting.functionTests.harness.RunTest
> lang/views.sql

I'm assuming '...' here means you've removed the actual contents of
classpath for brevity. Recently, there have been some issues with
running tests with useprocess=false. I'm guessing in this case that
the security manager is installed but the test harness could not find
the security policy (due to a security exception?) when running with
useprocess=false. What happens when you run with useprocess=true (or
just not setting useprocess)?

I realize that if what you're trying to do is use a debugger during
the execution of the test that it doesn't help much if the test runs
properly with useprocess=true, but fails with useprocess=false. Any
information about how the tests fail when running with
useprocess=false will help to fix the issues that exist with testing
running in that mode, though.

I think Myrna has been working with useprocess=false recently. She may
have more information about running tests in that mode.

andrew