Myrna van Lunteren wrote:
Hi,
When I run the test jdbcapi/getCurConnJdbc20 with db2jcc.jar (and
db2jcc_license_c.jar) in my classpath, like so:
java -Duseprocess=false
org.apache.derbyTesting.functionTests.harness.RunTest
jdbcapi/getCurConnJdbc20.sql
I get the following diff:
-------------------
14a15,20
> ERROR 38000: The exception 'java.lang.ExceptionInInitializerError'
was thrown
while evaluating an expression.
> ERROR XJ001: Java exception: ': java.lang.ExceptionInInitializerError'.
> ERROR XJ001: Java exception: 'access denied (
java.lang.RuntimePermission loadLibrary.db2jcct2):
java.security.AccessControlException'.
> ij> ------------------------------------------------------------
> -- drop the table
> drop table T;
16,19d21
< ij> ------------------------------------------------------------
< -- drop the table
< drop table T;
< 0 rows inserted/updated/deleted
---------------
(more fun and entertainment in the derby.log).
I don't understand why the call to the method
(...)util.Jdbc20Test.newJdbc20Method would attempt to load the jcc
driver? I'm not running networkserver here - just embedded...
Does this maybe mean that
driverManager.getConnection("jdbc:default:connection") goes through
all available drivers in the classpath?
Thx,
Myrna
Hi Myrna,
I think you have the derbynet.jar and derbyclient.jar also in your
classpath. When I ran the same test without derbynet.jar and
derbyclient.jar but with db2jcc and it's license I got the exception below
RunIJ --> java.security.AccessControlException: access denied
(java.io.FilePermi
ssion C:\test\getCurConnJdbc20\getCurConnJdbc20_app.properties read)
java.security.AccessControlException: access denied
(java.io.FilePermission
C:\test\getCurConnJdbc20\getCurConnJdbc20_app.properties read)
at
java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:264)
at
java.security.AccessController.checkPermission(AccessController.java:
427)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
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(Unknown
Source)
at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
at org.apache.derby.tools.ij.main(Unknown Source)
at
org.apache.derbyTesting.functionTests.harness.RunIJ.run(Unknown Sourc
e)
at java.lang.Thread.run(Thread.java:595)
Exception in thread "main" java.security.AccessControlException: access
denied (
java.util.PropertyPermission * read,write)
at
java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:264)
at
java.security.AccessController.checkPermission(AccessController.java:
427)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at
java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:
1252)
at java.lang.System.getProperties(System.java:560)
at
org.apache.derbyTesting.functionTests.harness.RunTest.execTestNoProce
ss(Unknown Source)
at
org.apache.derbyTesting.functionTests.harness.RunTest.testRun(Unknown
Source)
at
org.apache.derbyTesting.functionTests.harness.RunTest.main(Unknown So
urce)
I think the error is related to the policy file permission.
Thanks
Manjula