How to fix the ADF Security error “JpsAnonymousRoleImpl” in Jdev 11.1.1.6.0

I have created a sample ADF application in Jdev 11.1.1.6.0 and when executed in “Integrated Weblogic server” within Jdev, it did not display any error message in the console and the application web page is loaded in the default browser successfully.

Now I added the ADF Security for the Application. To do this, From the Menu options select the Application –> select Secure->Configure ADF Security

ADF Authentication and Authorization –> Form Based Authentication (Generate the default login and error pages. Should be something like “/login.html“) -> No Automatic Grants -> Finish.

Now when I executed my Application in Jdev, I was getting the “<CodebasePolicyHandler> <migrateDeploymentPolicies> Migration of codebase policy failed. Reason: {0}. oracle.security.jps.JpsException: java.lang.IllegalArgumentException: oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl”   error before my web page opens up in the browser.

Even after you delete the ADF security this error still occurs.

So Now lets see how to fix this error in the below steps.

1) Now open your newly JDev created jazn-data.xml file. It’s located in the Application Resources panel (usually located by your Data Controls and Projects expandable panels).

2) On the left, Select the Resource Grants –> Resource Type (Web Page dropdown) –> error page should have a key symbol by it.

3) Delete the anonymous role in the “Granted To” column. Now click the green button to add an Application Role.  You will find TWO “anonymous role” options, which is causing this error. So we have to delete some XML code in jazn-data.xml file.

4) To edit the jazn-data.xml file, Click the Source tab on the bottom of the page to open up the XML View. You’ll see the following piece of code.

<?xml version = ‘1.0’ encoding = ‘UTF-8’ standalone = ‘yes’?>
<jazn-data xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
           xsi:noNamespaceSchemaLocation=”http://xmlns.oracle.com/oracleas/schema/jazn-data-11_0.xsd”&gt;
  <jazn-realm default=”jazn.com”>
    <realm>
      <name>jazn.com</name>
    </realm>
  </jazn-realm>
  <policy-store>
    <applications>
      <application>
        <name>BoxLocatorSheetApp</name>
        <app-roles>
<app-role>
            <name>anonymous-role</name>
            <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class>
            <display-name>anonymous-role</display-name>
          </app-role>
</app-roles>
        <jazn-policy>
          <grant>
            <grantee>
              <principals>

5) The <app-role>  </app-role> code in red font need to be either DELETED or COMMENTED. Then SAVE the jazn-data.xml file.

6) Go back to the Resource Grants tab -> Resource Type (Web Page) and delete any “Granted To” authorizations that may assigned to error and login pages.

7) Assigned a “Granted To” application role of “anonymous-role” to the error and login pages. Now here you will find only one “anonymous-role” option available to Grant to the Pages.

Now I executed the ADF application and I did not see the error in the “Integrated Weblogic Server” console in Jdev before my web page opens up in the browser.

So the error is Fixed.Cheers.

Advertisements
This entry was posted in ADF (Application Development Framework), Jdeveloper, WebLogic Server 11g and tagged , , , , , , , , , . Bookmark the permalink.

7 Responses to How to fix the ADF Security error “JpsAnonymousRoleImpl” in Jdev 11.1.1.6.0

  1. Balu says:

    Thanks for the information.

    But what does this mean ? JDev 11.1.1.6.0 fails to enable ADF Security ?

    or this is a special case where ADF security cannot be enabled ?

    • udayarocks says:

      HI Balu,
      JDev 11.1.1.6.0 does not fail to enable ADF Security. But when you enable the ADF Security in your application, due to appearing “anonymous-role” twice in the Jazn-data.xml file, this error message appears in the Integrated Weblogic console. Usually this does not effect the Security functionality, but in Production environment, this message in the Server Console can misguide the support team.

      Regards,
      Udaya

      • Actually, it blocked me. Because of it I got infinite login loop (accessing protected ‘welcome’ page, redirected to ADF login servlet, redirected to login page, redirected beck to ADF login servlet, redirected to login page and so on)

  2. Rudy says:

    Thank you very much for posting this. I had no idea what was going on. This was my first attempt implementing ADF Security. I now have my login/logout functionality working properly.
    – Rudy

  3. rnobel@quobell.nl says:

    Thanks a lot for this very useful tip ! I spend quite some hours trying to fix this problem, it does not seem to be well documented either, so very useful post !!

    Regards Rob

  4. Reblogged this on Mohammad Esad-Djou's Blog and commented:
    How to fix the ADF Security error “JpsAnonymousRoleImpl” in Jdev 11.1.1.6.0

  5. Shiv says:

    Thanks for posting this information. It is quite useful information. It helped me in fixing the security issue happening in my application.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s