|
Problem(Abstract) |
The following error occurs when the "Test Connection"
button is pressed in the administrative console, V5.0.1 and greater. This
occurs after adding a new JDBC driver and datasource where WebSphere®
Application Server security and Java™ 2 security has been enabled:
W SECJ0314W: Current Java 2 Security policy reported a potential violation
of Java 2 Security Permission. Please refer to Problem Determination Guide
for further information. Permission:
ibm.db2.instance.path : access denied (java.util.PropertyPermission
ibm.db2.instance.path read)
Code: COM.ibm.db2.jdbc.app.DB2Driver in {file:/J:/Program
Files/SQLLIB/java12/db2java.zip}
Stack Trace:
java.security.AccessControlException: access denied
(java.util.PropertyPermission ibm.db2.instance.path read)
java.security.AccessControlContext.checkPermission(AccessControlContext.java(Compiled
Code))
java.security.AccessController.checkPermission(AccessController.java(Compiled
Code))
java.lang.SecurityManager.checkPermission(SecurityManager.java(Compiled
Code))
com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java(Compiled
Code))
java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1298)
java.lang.System.getProperty(System.java:601)
|
|
|
|
Cause |
This happens because WebSphere Application Server does not
have the necessary permissions to access a file. |
|
|
Resolving the
problem |
The way to resolve this is by using the policytool that
comes with websphere, it is not necessary to stop the appserver in order
to edit the policy files.
- Start policytool:
- Open a command prompt
- Enter:
%{was.install.root}/java/jre/bin/policytool
- After the PolicyTool window opens, PolicyTool
checks for the .java.policy file in your home directory.
- If it does not exist, an Error message displays. Click OK.
- Select File > Open.
- Navigate to the directory tree in the open window to select the policy
file that you need to update. After selecting the policy file, click
Open.
- The following will be displayed:
install_root/AppServer/config/cells/cell_name/nodes/node_name/app.policy
Select app.policy
- Once the code base entries are listed in the window, select Add
Policy Entry
- In the CodeBase field enter the path to your
db2java.zip in a URL format:
example: file://SQLLIB/java12/db2java.zip
- Click Add Permission
- Select AllPermission from the drop down menu and click
OK
- Click Done
- Click File > Save > OK
- Stop the node
- Stop the Application Server
- Start the Application Server
|
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|