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 Nirmal Fernando <ni...@gmail.com> on 2010/07/08 15:46:24 UTC

Enabling IO permissions

Hi All,

I'm getting following error stack trace while trying to read a content
of a file inside the class "XplainStatisticsTest.java".
How can I grant the permission to read these files to Derby?

Help is highly appreciated.
Thanks.

Stack trace:

.java.security.AccessControlException: access denied
(java.io.FilePermission 98614267-0129-adc8-49d3-ffffc4f6138e.xml read)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkRead(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.xmlTagCount(XplainStatisticsTest.java:737)
	at org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.disableXplainStyle(XplainStatisticsTest.java:553)
	at org.apache.derbyTesting.functionTests.tests.lang.XplainStatisticsTest.testSimpleQuery(XplainStatisticsTest.java:646)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
	at junit.textui.TestRunner.doRun(TestRunner.java:121)
	at junit.textui.TestRunner.start(TestRunner.java:185)
	at junit.textui.TestRunner.main(TestRunner.java:143)


-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Re: Enabling IO permissions

Posted by Nirmal Fernando <ni...@gmail.com>.
Thanks Rick.

On Thu, Jul 8, 2010 at 10:52 PM, Rick Hillegas <ri...@oracle.com> wrote:
> Hi Nirmal,
>
> ImportExportProcedureTest is a good place to start. Others should turn up if
> you grep the tests for extinout.
>
> Hope this helps,
> -Rick
>
> Nirmal Fernando wrote:
>>
>> Hi Rick,
>>
>> Thanks for the reply.
>>
>> If you don't mind please tell me some test files that are using the
>> testing framework's extinout directory?
>>
>> Thanks.
>>
>>
>> On Thu, Jul 8, 2010 at 9:40 PM, Rick Hillegas <ri...@oracle.com>
>> wrote:
>>
>>>
>>> Hi Nirmal,
>>>
>>> If the new i/o call is in code which is in the derbytools jar file, then
>>> you
>>> need to add an i/o permission to the derbytools block of permissions in
>>> derby_tests.policy. You can use one of the existing permissions there as
>>> a
>>> template. Note that you may not need to add a new permission. That policy
>>> file already grants the tools read/write/delete access to the testing
>>> framework's extinout directory. Provided that your test does its i/o to
>>> that
>>> directory (as other tests do), the existing permission should cover you.
>>>
>>> Hope this helps,
>>> -Rick
>>>
>>> Nirmal Fernando wrote:
>>>
>>>>
>>>> Yeah, Knut I think you're right.
>>>> But how can I add a new permission?
>>>>
>>>> On Thu, Jul 8, 2010 at 8:43 PM, Knut Anders Hatlen
>>>> <kn...@oracle.com> wrote:
>>>>
>>>>
>>>>>
>>>>> Nirmal Fernando <ni...@gmail.com> writes:
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> I'm getting following error stack trace while trying to read a content
>>>>>> of a file inside the class "XplainStatisticsTest.java".
>>>>>> How can I grant the permission to read these files to Derby?
>>>>>>
>>>>>>
>>>>>
>>>>> Perhaps more liberal permissions are needed in derby_tests.policy found
>>>>> in the functionTests/util directory?
>>>>>
>>>>> --
>>>>> Knut Anders
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Re: Enabling IO permissions

Posted by Rick Hillegas <ri...@oracle.com>.
Hi Nirmal,

ImportExportProcedureTest is a good place to start. Others should turn 
up if you grep the tests for extinout.

Hope this helps,
-Rick

Nirmal Fernando wrote:
> Hi Rick,
>
> Thanks for the reply.
>
> If you don't mind please tell me some test files that are using the
> testing framework's extinout directory?
>
> Thanks.
>
>
> On Thu, Jul 8, 2010 at 9:40 PM, Rick Hillegas <ri...@oracle.com> wrote:
>   
>> Hi Nirmal,
>>
>> If the new i/o call is in code which is in the derbytools jar file, then you
>> need to add an i/o permission to the derbytools block of permissions in
>> derby_tests.policy. You can use one of the existing permissions there as a
>> template. Note that you may not need to add a new permission. That policy
>> file already grants the tools read/write/delete access to the testing
>> framework's extinout directory. Provided that your test does its i/o to that
>> directory (as other tests do), the existing permission should cover you.
>>
>> Hope this helps,
>> -Rick
>>
>> Nirmal Fernando wrote:
>>     
>>> Yeah, Knut I think you're right.
>>> But how can I add a new permission?
>>>
>>> On Thu, Jul 8, 2010 at 8:43 PM, Knut Anders Hatlen
>>> <kn...@oracle.com> wrote:
>>>
>>>       
>>>> Nirmal Fernando <ni...@gmail.com> writes:
>>>>
>>>>
>>>>         
>>>>> I'm getting following error stack trace while trying to read a content
>>>>> of a file inside the class "XplainStatisticsTest.java".
>>>>> How can I grant the permission to read these files to Derby?
>>>>>
>>>>>           
>>>> Perhaps more liberal permissions are needed in derby_tests.policy found
>>>> in the functionTests/util directory?
>>>>
>>>> --
>>>> Knut Anders
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>>     
>
>
>
>   


Re: Enabling IO permissions

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Rick,

Thanks for the reply.

If you don't mind please tell me some test files that are using the
testing framework's extinout directory?

Thanks.


On Thu, Jul 8, 2010 at 9:40 PM, Rick Hillegas <ri...@oracle.com> wrote:
> Hi Nirmal,
>
> If the new i/o call is in code which is in the derbytools jar file, then you
> need to add an i/o permission to the derbytools block of permissions in
> derby_tests.policy. You can use one of the existing permissions there as a
> template. Note that you may not need to add a new permission. That policy
> file already grants the tools read/write/delete access to the testing
> framework's extinout directory. Provided that your test does its i/o to that
> directory (as other tests do), the existing permission should cover you.
>
> Hope this helps,
> -Rick
>
> Nirmal Fernando wrote:
>>
>> Yeah, Knut I think you're right.
>> But how can I add a new permission?
>>
>> On Thu, Jul 8, 2010 at 8:43 PM, Knut Anders Hatlen
>> <kn...@oracle.com> wrote:
>>
>>>
>>> Nirmal Fernando <ni...@gmail.com> writes:
>>>
>>>
>>>>
>>>> I'm getting following error stack trace while trying to read a content
>>>> of a file inside the class "XplainStatisticsTest.java".
>>>> How can I grant the permission to read these files to Derby?
>>>>
>>>
>>> Perhaps more liberal permissions are needed in derby_tests.policy found
>>> in the functionTests/util directory?
>>>
>>> --
>>> Knut Anders
>>>
>>>
>>
>>
>>
>>
>
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Re: Enabling IO permissions

Posted by Rick Hillegas <ri...@oracle.com>.
Hi Nirmal,

If the new i/o call is in code which is in the derbytools jar file, then 
you need to add an i/o permission to the derbytools block of permissions 
in derby_tests.policy. You can use one of the existing permissions there 
as a template. Note that you may not need to add a new permission. That 
policy file already grants the tools read/write/delete access to the 
testing framework's extinout directory. Provided that your test does its 
i/o to that directory (as other tests do), the existing permission 
should cover you.

Hope this helps,
-Rick

Nirmal Fernando wrote:
> Yeah, Knut I think you're right.
> But how can I add a new permission?
>
> On Thu, Jul 8, 2010 at 8:43 PM, Knut Anders Hatlen
> <kn...@oracle.com> wrote:
>   
>> Nirmal Fernando <ni...@gmail.com> writes:
>>
>>     
>>> I'm getting following error stack trace while trying to read a content
>>> of a file inside the class "XplainStatisticsTest.java".
>>> How can I grant the permission to read these files to Derby?
>>>       
>> Perhaps more liberal permissions are needed in derby_tests.policy found
>> in the functionTests/util directory?
>>
>> --
>> Knut Anders
>>
>>     
>
>
>
>   


Re: Enabling IO permissions

Posted by Nirmal Fernando <ni...@gmail.com>.
Yeah, Knut I think you're right.
But how can I add a new permission?

On Thu, Jul 8, 2010 at 8:43 PM, Knut Anders Hatlen
<kn...@oracle.com> wrote:
> Nirmal Fernando <ni...@gmail.com> writes:
>
>> I'm getting following error stack trace while trying to read a content
>> of a file inside the class "XplainStatisticsTest.java".
>> How can I grant the permission to read these files to Derby?
>
> Perhaps more liberal permissions are needed in derby_tests.policy found
> in the functionTests/util directory?
>
> --
> Knut Anders
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Re: Enabling IO permissions

Posted by Knut Anders Hatlen <kn...@oracle.com>.
Nirmal Fernando <ni...@gmail.com> writes:

> I'm getting following error stack trace while trying to read a content
> of a file inside the class "XplainStatisticsTest.java".
> How can I grant the permission to read these files to Derby?

Perhaps more liberal permissions are needed in derby_tests.policy found
in the functionTests/util directory?

-- 
Knut Anders