15 April 2011

TROUBLESHOOTING: oracle.security.jps.JpsRuntimeException: Cannot read from policy store.

If during development you get


<12 Apr 2011 10:49:36 μμ EEST>
          \logs\DefaultServer.log is opened. All server side log events will be written to this file.>
 
oracle.security.jps.JpsRuntimeException: Cannot read from policy store.
            at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.buildFromFile(XmlPolicyStore.java:425)
            at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.(XmlPolicyStore.java:224)
        ...
Caused by: oracle.security.jps.JpsRuntimeException: javax.xml.stream.XMLStreamException: End Document reached 
                                    prematurely.
            at oracle.security.jps.internal.core.datastore.xml.XmlDataStoreParser.getDataStoreEntryStax
                 (XmlDataStoreParser.java:166)
        ...
            ... 28 more
...
weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to 
               exception, see the exception stack trace or the server log file for root cause. If still see no obvious cause, enable the 
                debug flag -Djava.security.debug=jpspolicy to get more information. Error message: 
                oracle.security.jps.JpsException: [PolicyUtil] Exception while getting default policy Provider
          at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadOPSSPolicy
                                    (CommonSecurityServiceManagerDelegateImpl.java:1398)
        ...
Caused By: oracle.security.jps.JpsRuntimeException: oracle.security.jps.JpsException: [PolicyUtil] Exception while getting 
                default policy Provider
           at oracle.security.jps.internal.policystore.PolicyDelegationController.(PolicyDelegationController.java:291)
...       
Caused By: java.security.PrivilegedActionException: oracle.security.jps.JpsException: [PolicyUtil] Unable to obtain default 
               JPS Context!
            at java.security.AccessController.doPrivileged(Native Method)
...
Caused By: oracle.security.jps.JpsRuntimeException: Cannot read from policy store.
            at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.buildFromFile(XmlPolicyStore.java:425)
...



Solution
Try to remove jazn-data.xml and system-jazn-data.xml from the DefaultDomain.
For example under my DefaultDomain I have all these:


Although jazn-data is part of your application, it is copied to the domain because there is where the security is stored.

Note: I have changed my default path of JDeveloper's system folder. The default is C:\Documents and Settings\username\Application Data\JDeveloper\system11.1.1.4.37.59.23

3 comments:

  1. Does the application than recreate the system-jazn-data.xml and jazn-data.xml files upon restart if they don't exist?

    ReplyDelete
    Replies
    1. Hi Nick,
      Obviously it recreates them. Otherwise if an additional step was required I would have stated it.
      Nevertheless, it's been a while seems I logged this and I am not 100% sure.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete

You might also like:

Related Posts Plugin for WordPress, Blogger...
There was an error in this gadget